在构建时命名一个docker以及如何检索它 [英] Name a docker at build and how to retrieve it

查看:76
本文介绍了在构建时命名一个docker以及如何检索它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立一个docker镜像.然后在docker images命令上,列表显示:

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

我的Dockerfile中是否可以为该构建指定名称?还是在 docker build.命令行上?

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

另一个问题:我想通过SFTP在生产服务器上上传docker容器并运行它.容器存放在哪里?

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

推荐答案

您应使用该标记是可选的.

我想通过SFTP在生产服务器上上传docker容器并运行它.

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

您应该上传"图像,这意味着将其推送到 docker注册表在您的服务器上运行.

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

您还可以将正在运行的容器提交到中间映像中(如果在该容器中声明了一个容器,则冻结了容器的运行状态,但不会保留卷数据).然后复制该存档,然后 docker import 它.
请参阅"如何在不同主机之间移动Docker容器".

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".

一旦导入,请参阅"在主机上存储的Docker映像在哪里?".
(用于容器的/var/lib/docker/containers )

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

这篇关于在构建时命名一个docker以及如何检索它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆