Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What is going on with this article?
@ogontaro

Docker Registry構築メモ

More than 1 year has passed since last update.

スペック

Ubuntu 16.04
CPU: 2コア
Memory: 4GB

構成

  • 認証
    • htpasswdのファイルで管理
  • フロント
    • 別のNginxでSSL終端させる
    • ここは省略。SSL終端させて、5000ポートにプロキシさせれば動く

導入手順

Dockerの導入

sudo curl https://releases.rancher.com/install-docker/17.03.2.sh | sh
sudo gpasswd -a ubuntu docker
sudo systemctl restart docker
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo restart

htpasswd生成

mkdir -p ./registry/auth
docker run --rm --entrypoint htpasswd registry:2 -Bbn <username> <password> > ./registry/auth/htpasswd

Docker Compose

version: '3'
services:
  registry:
    restart: always
    image: registry:2
    ports:
      - 5000:5000
    environment:
      REGISTRY_HTTP_SECRET: <適当な文字列>
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
    volumes:
      - ./registry/data:/var/lib/registry
      - ./registry/auth:/auth

ログイン

docker login <registryのURL>

参考

2
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ogontaro
updata
不動産DXを推進しています。 主なプロダクト Syncaデータコンバーター Syncaワークフロー Syncaウェブサイト

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
2
Help us understand the problem. What is going on with this article?