1
1

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 1 year has passed since last update.

Docker | DOCKER CLOUD のレポジトリにイメージを作成する

Last updated at Posted at 2017-05-17

ここでは例として、既存レポジトリのイメージをそのまま、自分のレポジトリに push してみる。

Docker clould に登録する

https://cloud.docker.com/ より。

Docker clould にログインする

$ docker login

レポジトリを作成する

image

適当なイメージを pull してくる

$ docker pull alpine

イメージに対してタグを付ける

$ docker tag [イメージ] [ユーザー名]/[レポジトリ名]:[タグ]

例:

$ docker tag alpine yumainaura/alpine-copy:latest

( :latest は省略も出来る )

イメージの確認

$ docker images
REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
alpine                   latest              02674b9cb179        6 days ago          3.99 MB
yumainaura/alpine-copy   latest              02674b9cb179        6 days ago          3.99 MB

タグに対して push する

$ docker push [ユーザー名]/[レポジトリ名]:[タグ]

例:

$ docker push yumainaura/alpine-copy:latest

docker cloud で確認

反映されている。

image

pull の動作確認

手元のイメージを消してみる

$ docker rmi yumainaura/alpine-copy

リモートからコンテナを走らせる

$ docker run yumainaura/alpine-copy echo 'hello world'

イメージを pull して実行してくれるのが分かる。

Unable to find image 'yumainaura/alpine-copy:latest' locally
latest: Pulling from yumainaura/alpine-copy
Digest: sha256:c0537ff6a5218ef531ece93d4984efc99bbf3f7497c0a7726c88e2bb7584dc96
Status: Downloaded newer image for yumainaura/alpine-copy:latest
hello world

参考

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?