Help us understand the problem. What is going on with this article?

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>

参考

https://github.com/docker/distribution

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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした