1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Docker Registry構築メモ

Posted at

スペック

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>

参考

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?