mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-08-19 12:16:37 +00:00
only copy delta files when multistage build
For some Host OS configuration with redirect_dir on, extra data are saved on the upper layer when the same file exists on different layers. To minimize docker image size, remove the overlapped files before copy, when cgit, httpd, mariadb, memcached, nginx and postgres. Signed-off-by: Liu, Jianjun <jianjun.liu@intel.com>
This commit is contained in:
@@ -18,6 +18,15 @@ RUN source /os-release && \
|
||||
--bundles=sudo,curl,scm-server --no-scripts \
|
||||
&& rm -rf /install_root/var/lib/swupd/*
|
||||
|
||||
# For some Host OS configuration with redirect_dir on,
|
||||
# extra data are saved on the upper layer when the same
|
||||
# file exists on different layers. To minimize docker
|
||||
# image size, remove the overlapped files before copy.
|
||||
RUN mkdir /os_core_install
|
||||
COPY --from=clearlinux/os-core:latest / /os_core_install/
|
||||
RUN cd / && \
|
||||
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d || true
|
||||
|
||||
FROM clearlinux/httpd:latest
|
||||
|
||||
COPY --from=builder /install_root /
|
||||
|
||||
@@ -18,6 +18,15 @@ RUN source /os-release && \
|
||||
--bundles=httpd --no-scripts \
|
||||
&& rm -rf /install_root/var/lib/swupd/*
|
||||
|
||||
# For some Host OS configuration with redirect_dir on,
|
||||
# extra data are saved on the upper layer when the same
|
||||
# file exists on different layers. To minimize docker
|
||||
# image size, remove the overlapped files before copy.
|
||||
RUN mkdir /os_core_install
|
||||
COPY --from=clearlinux/os-core:latest / /os_core_install/
|
||||
RUN cd / && \
|
||||
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d || true
|
||||
|
||||
FROM clearlinux/os-core:latest
|
||||
MAINTAINER qi.zheng@intel.com
|
||||
|
||||
|
||||
@@ -20,6 +20,15 @@ RUN source /os-release && \
|
||||
--bundles=mariadb --no-scripts \
|
||||
&& rm -rf /install_root/var/lib/swupd/*
|
||||
|
||||
# For some Host OS configuration with redirect_dir on,
|
||||
# extra data are saved on the upper layer when the same
|
||||
# file exists on different layers. To minimize docker
|
||||
# image size, remove the overlapped files before copy.
|
||||
RUN mkdir /os_core_install
|
||||
COPY --from=clearlinux/os-core:latest / /os_core_install/
|
||||
RUN cd / && \
|
||||
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d || true
|
||||
|
||||
FROM clearlinux/os-core:latest
|
||||
MAINTAINER qi.zheng@intel.com
|
||||
|
||||
|
||||
@@ -18,6 +18,15 @@ RUN source /os-release && \
|
||||
--bundles=memcached --no-scripts \
|
||||
&& rm -rf /install_root/var/lib/swupd/*
|
||||
|
||||
# For some Host OS configuration with redirect_dir on,
|
||||
# extra data are saved on the upper layer when the same
|
||||
# file exists on different layers. To minimize docker
|
||||
# image size, remove the overlapped files before copy.
|
||||
RUN mkdir /os_core_install
|
||||
COPY --from=clearlinux/os-core:latest / /os_core_install/
|
||||
RUN cd / && \
|
||||
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d || true
|
||||
|
||||
FROM clearlinux/os-core:latest
|
||||
MAINTAINER qi.zheng@intel.com
|
||||
|
||||
|
||||
@@ -18,6 +18,15 @@ RUN source /os-release && \
|
||||
--bundles=nginx --no-scripts \
|
||||
&& rm -rf /install_root/var/lib/swupd/*
|
||||
|
||||
# For some Host OS configuration with redirect_dir on,
|
||||
# extra data are saved on the upper layer when the same
|
||||
# file exists on different layers. To minimize docker
|
||||
# image size, remove the overlapped files before copy.
|
||||
RUN mkdir /os_core_install
|
||||
COPY --from=clearlinux/os-core:latest / /os_core_install/
|
||||
RUN cd / && \
|
||||
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d || true
|
||||
|
||||
FROM clearlinux/os-core:latest
|
||||
MAINTAINER bin.yang@intel.com
|
||||
|
||||
|
||||
@@ -19,6 +19,15 @@ RUN source /os-release && \
|
||||
--path /install_root --statedir /swupd-state \
|
||||
--bundles=postgresql --no-scripts
|
||||
|
||||
# For some Host OS configuration with redirect_dir on,
|
||||
# extra data are saved on the upper layer when the same
|
||||
# file exists on different layers. To minimize docker
|
||||
# image size, remove the overlapped files before copy.
|
||||
RUN mkdir /os_core_install
|
||||
COPY --from=clearlinux/os-core:latest / /os_core_install/
|
||||
RUN cd / && \
|
||||
find os_core_install | sed -e 's/os_core_install/install_root/' | xargs rm -d || true
|
||||
|
||||
FROM clearlinux/os-core:latest
|
||||
|
||||
COPY --from=builder /install_root /
|
||||
|
||||
Reference in New Issue
Block a user