Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
916 views
in Technique[技术] by (71.8m points)

create multiple tag docker image

How can several tags be attached to one Docker image? Is it possible to create multiple tags using one Dockerfile?

It is possible, somehow; for example docker pull ubuntu will get several images, some of which have multiple tags:

ubuntu                  13.10               9f676bd305a4        2 weeks ago         182.1 MB
ubuntu                  saucy               9f676bd305a4        2 weeks ago         182.1 MB
ubuntu                  raring              eb601b8965b8        2 weeks ago         170.2 MB
ubuntu                  13.04               eb601b8965b8        2 weeks ago         170.2 MB
ubuntu                  12.10               5ac751e8d623        2 weeks ago         161.4 MB
ubuntu                  quantal             5ac751e8d623        2 weeks ago         161.4 MB
ubuntu                  10.04               9cc9ea5ea540        2 weeks ago         183 MB
ubuntu                  lucid               9cc9ea5ea540        2 weeks ago         183 MB
ubuntu                  12.04               9cd978db300e        2 weeks ago         204.7 MB
ubuntu                  latest              9cd978db300e        2 weeks ago         204.7 MB
ubuntu                  precise             9cd978db300e        2 weeks ago         204.7 MB
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Since 1.10 release, you can now add multiple tags at once on build:

docker build -t name1:tag1 -t name1:tag2 -t name2 .

Source: Add ability to add multiple tags with docker build


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...