Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GitLab-CI でPrivate Registry を利用する話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
athagi
May 28, 2021
Technology
1.6k
0
Share
GitLab-CI でPrivate Registry を利用する話
20210528 DockerCon 2021 & Docker Meetup Tokyo #35 でLTした話です。
athagi
May 28, 2021
More Decks by athagi
See All by athagi
社内でAWS GameDayを開催しよう
athagi
2
560
petなEC2をまとめて監視してみた
athagi
1
270
既存の仕組みを棄てる技術
athagi
0
820
冴えない開発環境の育てかた
athagi
0
110
Kubernetes がない世界の CloudNative ジャーニー
athagi
0
440
ゆるキャンはじめました。
athagi
0
1.7k
Windows Server にAnsibleを使ってみた話
athagi
2
2.2k
Other Decks in Technology
See All in Technology
EMから幅を広げるために最近挑戦していること / Recent challenges I'm undertaking to expand my horizons beyond EM
hiro_torii
1
180
会社説明資料|株式会社ギークプラス ソフトウェア事業部
geekplus_tech
0
190
生成AIはソフトウェア開発の革命か、ソフトウェア工学の宿題再提出なのか -ソフトウェア品質特性の追加提案-
kyonmm
PRO
2
860
AIの揺らぎに“コシ”を与える階層化品質設計
ickx
0
260
GitHub Copilot CLI と VS Code Agent Mode の使い分け
tomokusaba
0
140
AIエージェントの支払い基盤 AgentCore Payments概要
kmiya84377
1
130
Vision Banana: Image Generators are Generalist Vision Learners
kzykmyzw
0
310
MySQL 9.7がやってきた ~これまでのあらすじと基本情報~ @ 日本MySQLユーザ会会2026年04月 / mysql97-yattekita
sakaik
0
170
Oracle Cloud Infrastructure:2026年4月度サービス・アップデート
oracle4engineer
PRO
0
370
多角的な視点から見たAGI
terisuke
0
120
Oracle Cloud Infrastructure presents managed, serverless MCP Servers for Oracle AI Database
thatjeffsmith
0
110
オライリーイベント登壇資料「鉄リサイクル・産廃業界におけるAI技術実応用のカタチ」
takarasawa_
0
330
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
130
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
160
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
500
For a Future-Friendly Web
brad_frost
183
10k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
70
39k
Done Done
chrislema
186
16k
4 Signs Your Business is Dying
shpigford
187
22k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
900
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
500
Evolving SEO for Evolving Search Engines
ryanjones
0
190
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
The SEO Collaboration Effect
kristinabergwall1
1
440
Transcript
GitLab-CI で Private Registry を利用する話 USE TEMPLATE Click あさぎ(@_athagi) DockerCon
2021 & Docker Meetup Tokyo #35 (#dockertokyo)
GitLab-CI • GitLab 8.0 で本体に統合されたCICDツール • GitLab 12.x / 13.x
で機能強化 • yaml で書ける
Runner Manager docker pull git push docker-machine create
docker-machine • 2018年 メンテナンスモードに • GitLab ではFork して利用
Docker Hub rate limit が開始 • 2020年11月から • anonymous: 100pulls/6h
• IPアドレスに対して制限 • authenticated: 200pulls/6h https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/
Docker Hub rate limit が開始 • 2020年11月から • anonymous: 100pulls/6h
• IPアドレスに対して制限 • authenticated: 200pulls/6h https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/
Runner Manager docker pull git push
一瞬で rate limit 超過...
Runner Manager docker pull git push ecr public ecr
Private registry にログインする必要がある • docker login • ecr-credential-helper
実現したかったこと • CI を実行する際にECRのイメージを透過的に利用したい • CIで docker イメージの build &
push したい • できる限り管理するものは減らしたい
Runner Manager metadata service gitlab-runner ecr-credential-helper .ecr/cache.json docker-machine docker-machine create
dokcer run + payload config.toml (DOCKER_AUTH_CONFIG) docker.sock docker.sock awscli docker pull/push/login ECR read (Instance Profile)
Runner Manager metadata service gitlab-runner ecr-credential-helper .ecr/cache.json docker-machine docker-machine create
dokcer run + payload config.toml (DOCKER_AUTH_CONFIG) docker.sock docker.sock awscli docker pull/push/login ECR read (Instance Profile) pull
Runner Manager metadata service gitlab-runner ecr-credential-helper .ecr/cache.json docker-machine docker-machine create
dokcer run + token config.toml (DOCKER_AUTH_CONFIG) docker.sock docker.sock awscli docker pull/push/login ECR read (Instance Profile) build & push
Point • 利用者がイメージを利用する際は Credential を意識する必要 がない • ECR の認証は ecr-credential-helper
& Instance Profile • Official Image が Docker Hub だけにあり、パブリックレジストリ にないイメージは運用を考える必要があるった
うれしいニュース!!!
まとめ • docker-machine はメンテナンスモードなので GitLab-CI では Fork して利用 • client
側で token を取得して docker run 時に host に一緒に 渡している • docker-credential-helper を利用することで透過的に利用でき るようになる
参考資料 • docker-machine ◦ https://docs.docker.com/machine/ ◦ https://docs.docker.com/machine/drivers/aws/#options ◦
https://github.com/docker/machine/issues/4537#issue-341148889 • amazon-ecr-credential-helper ◦ https://github.com/awslabs/amazon-ecr-credential-helper • Autoscaling GitLab Runner on AWS EC2 ◦ https://docs.gitlab.com/runner/configuration/runner_autoscale_aws/ • Define an image from a private Container Registry ◦ https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#define-an-image-from-a-privat e-container-registry