0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure Piplinesでコンテナー リソースでAzure Container Registry(ACR)のイメージを参照する

Posted at

きっかけ

直接、Docker Hubからも取れるけど、Limitに引っ掛かる

/usr/bin/docker pull postgres:16-alpine
Error response from daemon: unauthorized: authentication required

Dockerの個人アカウントでPersonal access token作る

スクリーンショット 2024-09-25 10.58.37.png

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

スクリーンショット 2024-09-25 10.49.40.png

Azure DevOpsでService connections作る

スクリーンショット 2024-09-25 11.09.16.png

スクリーンショット 2024-09-25 11.10.24.png

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

本家の更新を反映する

また後で

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?