如何将多个图像组合成一个? [英] How do I combine several images into one?

查看:186
本文介绍了如何将多个图像组合成一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个图像(第三方),例如设置一个mysql,设置通用php应用程序环境,设置第三方工具。

I have several images (3rd parties) which eg setup a mysql, set up a generic php app environment, set up 3rd parties tools.

我想要一个Dockerfile / Docker图像组合了这些图像,然后运行一些更多的命令。

I want to make a Dockerfile / Docker Image which combines both those images and then runs some more commands

imageA --
            \
imageV --    ---> sharedImageA..X
            /
imageX --


推荐答案

你可以链接他们。你可以在这里找到更多

You can chain them. You can find more here

https://github.com/docker/docker/issues/3378#issuecomment-31314906

从上述链接获取

## Dockerfile.genericwebapp might have FROM ubuntu
cat Dockerfile.genericwebapp | docker build -t genericwebapp -
## Dockerfile.genericpython-web would have FROM genericwebapp
cat Dockerfile.genericpython-web | docker build -t genericpython-web -
## and then this specific app i'm testing might have a docker file that containers FROM genericpython-web
docker build -t thisapp .

上述的作者 SvenDowideit

一般来说,一个不错的做法是在同一个进程上运行多个运行的进程容器。

In general though, it's a bad practice to have more than one running processes on the same container.

这篇关于如何将多个图像组合成一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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