我想組裝一些圖像,並將其與我的dockerfile一起存儲。我對COPY或ADD的期望是合併行爲。但是,如果使用這些指令,則會覆蓋文件層次結構。因此,如果父路徑中的文件位於路徑中,則它們不再可用。 (巨大的問題舉例來說如果我是爲了節省的/ etc/mycoolstuff/filehere一些文件)ADD和COPY合併一個目錄的內容和已經生成的目錄的內容
發生這種情況時,我無法使用apt-get更多
我也看到了一些建議轉換我文件打包成tar,但沒有觀察到任何不同。
爲了清楚起見,這是問題之一(建立,如果我更改順序,但它結束反正壞的原因孩子的圖像將無法使用apt再):
ADD build/image-base.tgz/
RUN apt-get clean -y && \
apt-get update && \
apt-get install unzip -y --no-install-recommends && \
apt-get install gosu -y --no-install-recommends && \
apt-get clean -y && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com'
Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com'
Failed to fetch http://ppa.launchpad.net/webupd8team/java/ubuntu/dists/xenial/InRelease
Temporary failure resolving 'ppa.launchpad.net'
Some index files failed to download. They have been ignored, or old ones used instead.
你可以發佈你執行的命令嗎? – German
最後一個是:ADD \t build/image-base.tgz/ – Victor
那裏,我有一個簡單的文件結構與tomcat8配置:etc/tomcat8/catalina.properties例如 – Victor