Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker how to commit images with name on repository and tag

Tags:

docker

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

like image 293
Yuday Avatar asked Nov 30 '15 10:11

Yuday


People also ask

How do I create a docker image with a tag name?

To give tag to a docker file during build command: docker build -t image_name:tag_name . otherwise it will give latest tag to you image automatically.

How do I push an image to Docker Hub with tag?

To push an image to Docker Hub, you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web. You can add multiple images to a repository by adding a specific :<tag> to them (for example docs/base:testing ).

Which label is applied to a docker image in a repository?

Labels are used in Dockerfile to help organize your Docker Images.

Which technique is used to tag a docker image?

To apply a Docker image tag to a build, use the -t switch. For example, this creates a tag of "myapp_debug" on the image: docker build -t myapp:debug -f Dockerfile.


2 Answers

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.

like image 164
Criveti Mihai Avatar answered Oct 28 '22 04:10

Criveti Mihai


Running this syntax

$ sudo docker tag 87ab1f8aeb2f name_your_images:latest

Example

$ sudo docker tag 87ab1f8aeb2f ubuntu_test:14.04
like image 25
Yuday Avatar answered Oct 28 '22 02:10

Yuday