具有多个图像的Docker私人仓库

时间:2015-07-02 11:25:45

标签: docker

我们可以在单个私人仓库上托管多个图片吗?

  1. 的ubuntu:12.04
  2. ubuntu:14.04
  3. 所以我的私人回购像MYREPO:ubuntu:12.04和ubuntu:14.04

1 个答案:

答案 0 :(得分:14)

# Create a container
docker run --name image1 -it busybox echo Image1
# Commit container to new image
docker commit image1 amjibaly/stuff:image1
# Push to dockerhub repo
docker push amjibaly/stuff:image1

# Create a second container
docker run --name image2 -it busybox echo Image2
# Commit container to new image
docker commit image2 amjibaly/stuff:image2
# Push to same dockerhub repo with different tag
docker push amjibaly/stuff:image2