きっかけ
直接、Docker Hubからも取れるけど、Limitに引っ掛かる
/usr/bin/docker pull postgres:16-alpine
Error response from daemon: unauthorized: authentication required
Dockerの個人アカウントでPersonal access token作る
Azure Container Registry(ACR)にインポート
az acr import --name $registry_name --source docker.io/library/postgres:16-alpine --image postgres:16-alpine --username $DOKER_USER_ID --password $Personal_access_token
- リソースグループ(resourceGroup)
- レジジストリ(registry): $registry_name
- リポジトリ(repository): postgres
- タグ: 16-alpine
Azure DevOpsでService connections作る
resources:
containers:
- container: 'postgres'
type: ACR
resourceGroup: $(resourceGroup)
registry: $(registry)
repository: postgres
image: postgres:16-alpine
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
azureSubscription: 'MyAcrServiceConnection'
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
本家の更新を反映する
また後で