docker build 遇到的问题
Closed this issue · 12 comments
#Set mysql user && Load configured cacti sql by Leniy, to prevent manually configuration at first visit
mv: cannot move '/tmp/scripts/configured_cacti.sql' to '/var/cactibackups/cacti_backups.sql': No such file or directory
请指教
执行COPY / /tmp的时候,把整个项目文件夹复制过去了么?
不太清楚,我是直接进入文件夹 执行docker build -t cacti . 的
Step 4 : COPY / /tmp/
---> 473929a850e4
Removing intermediate container c7c5a25c7602 应该是复制过去了
稍等,我建个环境测试一下。
--2017-11-21 16:03:15-- https://github.com/leniy/docker-cacti/archive/master.zip Resolving github.com (github.com)... 192.30.255.113, 192.30.255.112 Connecting to github.com (github.com)|192.30.255.113|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://codeload.github.com/leniy/docker-cacti/zip/master [following] --2017-11-21 16:03:16-- https://codeload.github.com/leniy/docker-cacti/zip/master Resolving codeload.github.com (codeload.github.com)... 192.30.255.120, 192.30.255.121 Connecting to codeload.github.com (codeload.github.com)|192.30.255.120|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/zip] Saving to: ‘master.zip’
你用的哪个版本的docker?最新版本的docker-ce?
1.12.6
Server:
Version: 1.12.6
API version: 1.24
Go version: go1.6.2
Git commit: 78d1802
Built: Tue Jan 31 23:35:14 2017
OS/Arch: linux/amd64
应该是您这个不支持 docker build 创建镜像把,我现在用 docker-compose up -d 试了下,看起来似乎可以,不过还在跑
我用的:
Version: 17.09.0-ce
API version: 1.32
找到问题了,是因为docker更新和变动的频次太高,不同的版本细节不同,如“自动创建不存在的目录”这一条,有的就不支持。
你在第32行
; mv /tmp/scripts/configured_cacti.sql /var/cactibackups/cacti_backups.sql \
的上面一条,添加上
; mkdir /var/cactibackups \
就可以了
好的,我试试
建议你安装最新的版本,现在api已经到1.32了,你安装的还是1.24
docker更新换代的太快