docker commit 没起作用


新手刚接触docker, 按示例做了个jenkins的Dockerfile并生成了镜像v1,之后启动镜像加了些插件并构建了一个job,stop后再commit成新镜像v2,再启动则和v1一样,安装的插件和job都没有了,为什么呢?求大牛解答,谢谢
已邀请:

徐新坤 - 京东商城-TIG-JDOS团队

赞同来自:


提供一下docker inspect v1的结果以及你安装插件的路径。
我猜测你是把插件安装到了外挂存储上。

potti

赞同来自:


谢谢你的回复,插件我是下载到本机,在jenkins网页上手动选择安装的。唯一maven是通过COPY命令放进去的
root@ubuntu:~# docker inspect own/jenkins:v1
[{
"Architecture": "amd64",
"Author": "potti",
"Comment": "",
"Config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": null,
"CpuShares": 0,
"Cpuset": "",
"Domainname": "",
"Entrypoint": ,
"Env": ,
"ExposedPorts": {
"50000/tcp": {},
"8080/tcp": {}
},
"Hostname": "467bb73843f5",
"Image": "0ee5e56de4899891378b3a8e0a89aeac04d15a3238d1496a97fb9d0a10276a96",
"Labels": {},
"MacAddress": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OnBuild": [],
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "jenkins",
"Volumes": {
"/var/jenkins_home": {}
},
"WorkingDir": ""
},
"Container": "206ab1e3af353984d7af42c01d52892a65470f28f0040b0a34d40073e20e48cd",
"ContainerConfig": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": ,
"CpuShares": 0,
"Cpuset": "",
"Domainname": "",
"Entrypoint": ,
"Env": ,
"ExposedPorts": {
"50000/tcp": {},
"8080/tcp": {}
},
"Hostname": "467bb73843f5",
"Image": "0ee5e56de4899891378b3a8e0a89aeac04d15a3238d1496a97fb9d0a10276a96",
"Labels": {},
"MacAddress": "",
"Memory": 0,
"MemorySwap": 0,
"NetworkDisabled": false,
"OnBuild": [],
"OpenStdin": false,
"PortSpecs": null,
"StdinOnce": false,
"Tty": false,
"User": "jenkins",
"Volumes": {
"/var/jenkins_home": {}
},
"WorkingDir": ""
},
"Created": "2015-05-30T06:47:24.889316329Z",
"DockerVersion": "1.6.0",
"Id": "eb32a5b14972baf75138614d50f13bcce151382b5ad787d8570c255d4e5cec0e",
"Os": "linux",
"Parent": "0ee5e56de4899891378b3a8e0a89aeac04d15a3238d1496a97fb9d0a10276a96",
"Size": 0,
"VirtualSize": 667946069
}
]

wangzi19870227 - sina攻城狮,docker爱好者

赞同来自:


把你操作命令及过程贴出来看看吧

potti

赞同来自:


其实DockerFile 也很简单
FROM jenkins:latest
MAINTAINER potti

COPY apache-maven-3.0.5/ /tmp/maven-3.0.5/
ENV MAVEN_HOME /tmp/maven-3.0.5
ENV PATH $PATH:$MAVEN_HOME/bin

当中的操作有很多,但都是通过jenkins页面做的

wencan - IT杂工

赞同来自:


为什么是临时目录?

要回复问题请先登录注册