Docker notes

From Wiki
Jump to: navigation, search

Build image

Create a Dockerfile, then build the image.

cd /work_dir
docker build -t <tag> .

Push image to a private registry

Tag your image with your registry name.

docker tag <image>

Then docker push using that same tag.

docker push

Rename image

Docker how to change repository name or rename image

docker tag server:latest myname/server:latest


docker tag d583c3ac45fd myname/server:latest

Tags are just human-readable aliases for the full image name (d583c3ac45fd...).

So you can have as many of them associated with the same image as you like. If you don't like the old name you can remove it after you've retagged it:

docker rmi server

That will just remove the alias/tag. Since d583c3ac45fd has other names, the actual image won't be deleted.