Reputation: 4509
I've made the images of Ubuntu 14:04, on my local laptop. Then I want to commit images,
I run this command to commit
$ sudo Docker commit 2a1aef6a0547
However, there is no name on the repository and TAG
Like this, check images
$ sudo docker images
The results
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
<none> <none> 87ab1f8aeb2f 12 minutes ago 5.34 GB
ubuntu 14.04 e9ae3c220b23 2 weeks ago 187.9 MB
Name repository and tag is <none>
To be able to give a name, use syntax like??
Upvotes: 13
Views: 19139
Reputation:
To answer your question following is the syntax:
docker commit -a "Author Name" -m "Commit message" container-id/container-name new-image-name
where -a
& -m
are optional and /
denotes an or condition so it is container id or container name.
example for the same is:
docker commit -a "Some Name Here" -m "Simple nginx hosted on 8080" hello-nginx-container hello-nginx-yj
Now to be able to push this image to docker hub the new-image-name must be prefixed with YOUR_DOCKERHUB_USERNAME/
.
I have created an example Docker project, it includes more details about this exact same question in the documentation.
All the links mentioned above are my own github repo links.
Upvotes: 1
Reputation: 4509
Running this syntax
$ sudo docker tag 87ab1f8aeb2f name_your_images:latest
Example
$ sudo docker tag 87ab1f8aeb2f ubuntu_test:14.04
Upvotes: 5
Reputation: 361
Check the docker commit usage parameters:
Usage: docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
In fact, the example presented there shows how to do this:
$ docker commit c3f279d17e0a SvenDowideit/testimage:version3
f5283438590d
$ docker images
REPOSITORY TAG ID CREATED VIRTUAL SIZE
SvenDowideit/testimage version3 f5283438590d
Depending on what you are trying to do though - you may wish to start building images from a(n) (existing) Dockerfile
instead.
Upvotes: 21