Skip to content

Instantly share code, notes, and snippets.

@hagix9
Last active February 23, 2017 20:30
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hagix9/7287649 to your computer and use it in GitHub Desktop.
Save hagix9/7287649 to your computer and use it in GitHub Desktop.
Dockerでプライベートリポジトリを使う
#プライベートリポジトリ用コンテナを起動
docker run -d -p 5000:5000 samalba/docker-registry
#実験のために適当なコンテナを起動
docker run -i -t -d --name cent01 centos /bin/bash
#起動したコンテナをコミットしてタグ付け
docker commit cent01 test1/centos
docker tag test1/centos 192.168.10.60:5000/centos_test
#コミットしたコンテナをリポジトリにプッシュ
docker push 192.168.10.60:5000/centos_test
#DockerをインストールしたLAN内の他のパソコンから
docker pull 192.168.10.60:5000/centos_test
docker run -i -t 192.168.10.60:5000/centos_test /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment