BlackHoleGalaxy
BlackHoleGalaxy

Reputation: 9662

Name a docker at build and how to retrieve it

I tried to build a docker image. Then on docker images command, the list displays:

REPOSITORY     TAG        IMAGE ID            CREATED     SIZE  
<none>         <none>     eaaf8e203bd4        1 min ago   253.2 MB

Is there a way in my Dockerfile to specify a name for this build? Or at docker build . command line?

Another question: I want to upload via SFTP the docker container on my production server and run it. Where are the containers stored?

Upvotes: 1

Views: 2037

Answers (1)

VonC
VonC

Reputation: 1323453

You should use the -t option of docker build

docker build -t name:tag

The tag is optional.

I want to upload via SFTP the docker container on my production server and run it.

You should "upload" the image, and by that I mean push it to a docker registry running on your server.

You could also commit a running container into an intermediate image (which would freeze the running state of the container, but would not preserve the volume data, if one was declared in that container)
Then copy that archive, and docker import it.
See "How to move docker containers between different hosts".

Once imported, see "Where are docker images stored on the host machine?".
(/var/lib/docker/containers for containers)

Upvotes: 3

Related Questions