【发布时间】:2015-12-01 06:59:30
【问题描述】:
昨天有人问我如何使用 dockerfile 制作 docker 镜像
这次我想补充一个问题
如果我想在已安装的镜像 docker 上制作操作系统 ubuntu 14:04,postgresql-9.3.10,安装 Java JDK 6,复制文件(重要位置),并在镜像上创建用户。
我是否可以根据图像需要组合几个 dockerfile? (postgresql的dockerfile,java,copyfile,和创建用户这样一个dockerfile)
示例。我制作了一个 dockerfile “ubuntu” 其中包含命令
顶行
# Create dockerfile
# get OS ubuntu to images
FROM ubuntu: 14:04
# !!further adding a command on the following link, below the line per-dockerfile(intends command in dockerfile on the link)
# command on dockerfile postgresql-9.3
https://github.com/docker-library/postgres/blob/ed23320582f4ec5b0e5e35c99d98966dacbc6ed8/9.3/Dockerfile
# command on dockerfile java
https://github.com/docker-library/java/blob/master/openjdk-6-jdk/Dockerfile
# create a user on images ubuntu
RUN adduser myuser
# copy file/directory on images ubuntu
COPY /home/myuser/test /home/userimagedockerubuntu/test
# ?
CMD ["ubuntu:14.04"]
请帮帮我
【问题讨论】:
标签: image docker containers