Docker:保存 - 不产生输出

标签 docker save export metadata dockerfile

使用 Docker 相当新。

我为 Oracle 11g Full 提取了一个图像。创建了一个数据库并将应用程序安装到容器中。

正确配置后,我提交了生成 15GB 镜像的容器。

测试了该图像的新容器,一切正常,Oracle 服务等自动启动,然后我只是附加并运行应用程序......一切都很好。

我需要将其上传到服务器上,所以我的预期方法是:

1) 保存容器
2)上传压缩包到服务器
3) 装载容器

但是,当我运行以下命令时:
sudo docker save --output ~/etlf_961_meta.tar etlf/informatica9.6.1:latest
它只是挂起并且不产生任何输出。

进程处于事件状态,但没有文件出现,也没有事件:
T20 chris # ps aux | grep "docker save" root 26179 0.0 0.0 91928 5000 pts/14 S+ 16:36 0:00 sudo docker save --output /home/chris/etlf_961_meta.tar etlf/informatica9.6.1:latest root 26201 0.0 0.0 127404 14664 pts/14 Sl+ 16:36 0:00 docker save --output /home/chris/etlf_961_meta.tar etlf/informatica9.6.1:latest root 26277 0.0 0.0 14232 980 pts/0 S+ 16:36 0:00 grep --color=auto docker save
如果我使用 exportimport该过程运行良好,生成了一个 15GB 的图像并且可以导入,但是我丢失了所有的 ENV 和 CMD 元数据。

任何人都可以建议:

1) 如何解决save命令,实际导出容器
或者
2) 如何将 ENV/CMD 元数据(..dockerfile?)恢复或附加到导出/导入的图像?

非常感激

最佳答案

由于您是 docker 新手,因此我想提出一些可以让您的生活更轻松的建议:

I committed the container which resulted in a 15GB image.


commit通常不建议将其用于标准工作流程。它不是真正可重现的。我建议创建一个 Dockerfile使用 FROM <oracle image>并在 Dockerfile 中工作.

如果您有大型数据集,您可能希望在卷或主机绑定(bind)挂载(又名卷挂载)中管理这些数据集。

I need to upload this onto a server,



推荐的方法是使用 docker push推送到注册表。

it just hangs and produces no output.



可能是它很慢?您还可以检查 docker daemon 日志文件以查看是否有任何警告。

How to restore or attach the ENV/CMD metadata (..the dockerfile?) to a exported/imported image?



我不认为这是可能的。

关于Docker:保存 - 不产生输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39664746/

相关文章:

docker - 无法为 windows 安装 docker

docker - Traefik Docker 热重载配置

docker - dockerfiles中的docker卷

export - JasperReports - 指定允许的导出器

ssl - Docker 容器未连接到 https 端点

php - 通过php获取内容从url保存图片

c++ - 在c++中相对保存文件

android - 保存用户个人资料详细信息 android 应用程序的最佳方式

JavaScript ||将 API 与 ES6 模块结合使用

android - 从 Android Studio 中移除项目