合并两个Docker映像 [英] Merge two docker images

查看:119
本文介绍了合并两个Docker映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望使用docker进行一些生物信息学分析。

I'm hoping to use docker to set up some bioinformatic analysis.

我找到了两个我想使用的docker镜像:

I have found two docker images that I would like to use:


  1. jupyter / datascience-notebook

  2. bioconductor / devel_base

我已经成功地独立运行了每个图像,但是我不知道如何将它们合并在一起。

I have been successful in running each of these images independently, however I don't know how to merge them together.

正在合并两个docker容器可能吗?还是从一个开始,然后手动安装另一个功能?

Is merging two docker containers possible? Or do you start with one, and then manually install the features of the other?

推荐答案

您不能只合并图像。您必须根据所需的每个图像重新创建自己的图像。您可以像这样下载两个映像并为每个映像重新创建Docker文件:

You can't just merge the images. You have to recreate your own based on what was in each of the images you want. You can download both images and re-create the Docker files for each like this:

docker history --no-trunc=true image1 > image1-dockerfile
docker history --no-trunc=true image2 > image2-dockerfile

用要查看其历史记录的图像替换image1和image2。之后,您可以使用这些dockerfiles来构建自己的映像,这是两者的结合。

Substitute the image1 and image2 with the images you want to see the history for. After this you can use those dockerfiles to build your own image that is the combination of the two.

美中不足的是,任何ADD或COPY命令都不会显示复制的内容,因为您无权访问创建原始图像的本地文件系统。不需要任何运气,或者您可以从图像本身中获取任何遗漏的地方。

The fly in the ointment here is that any ADD or COPY commands will not reveal what was copied because you don't have access to the local file system from which the original images were created. With any luck that won't be necessary or you can get any missing bits from the images themselves.

这篇关于合并两个Docker映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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