diff --git a/golang/Dockerfile b/golang/Dockerfile index 4dbc770..1a840c0 100644 --- a/golang/Dockerfile +++ b/golang/Dockerfile @@ -1,11 +1,36 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER qi.zheng@intel.com ARG swupd_args - +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct RUN swupd update --no-boot-update $swupd_args -RUN swupd bundle-add go-basic $swupd_args \ - && rm -rf /var/lib/swupd/* + +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,go-basic --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 / ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH diff --git a/node/Dockerfile b/node/Dockerfile index 33f170b..e5c232d 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -1,10 +1,36 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER jianjun.liu@intel.com ARG swupd_args - +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct RUN swupd update --no-boot-update $swupd_args -RUN swupd bundle-add nodejs-basic $swupd_args \ - && rm -rf /var/lib/swupd/* + +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,nodejs-basic --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 / CMD ["node"] diff --git a/openjdk/Dockerfile b/openjdk/Dockerfile index ceb8cd0..c289fa2 100644 --- a/openjdk/Dockerfile +++ b/openjdk/Dockerfile @@ -1,10 +1,36 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER long1.wang@intel.com ARG swupd_args - +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct RUN swupd update --no-boot-update $swupd_args -RUN swupd bundle-add java-runtime $swupd_args && \ - rm -rf /var/lib/swupd/* + +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,java-runtime --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 / CMD ["java"] diff --git a/perl/Dockerfile b/perl/Dockerfile index 5807513..db2dd78 100644 --- a/perl/Dockerfile +++ b/perl/Dockerfile @@ -1,11 +1,36 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER qi.zheng@intel.com ARG swupd_args - +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct RUN swupd update --no-boot-update $swupd_args -RUN swupd bundle-add perl-extras $swupd_args \ - && rm -rf /var/lib/swupd/* + +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,perl-extras --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 / WORKDIR /root diff --git a/php/Dockerfile b/php/Dockerfile index ef7569e..a93fa46 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -1,10 +1,36 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER jianjun.liu@intel.com ARG swupd_args - +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct RUN swupd update --no-boot-update $swupd_args -RUN swupd bundle-add php-basic $swupd_args \ - && rm -rf /var/lib/swupd/* + +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,php-basic --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 / CMD ["php","-a"] diff --git a/python/Dockerfile b/python/Dockerfile index 62d4e77..cbda610 100644 --- a/python/Dockerfile +++ b/python/Dockerfile @@ -1,10 +1,36 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER hongzhan.chen@intel.com ARG swupd_args - +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct RUN swupd update --no-boot-update $swupd_args -RUN swupd bundle-add python3-basic $swupd_args \ - && rm -rf /var/lib/swupd/* + +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,python3-basic --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 / CMD ["python3"] diff --git a/rabbitmq/Dockerfile b/rabbitmq/Dockerfile index 47d385e..8d2b0ea 100644 --- a/rabbitmq/Dockerfile +++ b/rabbitmq/Dockerfile @@ -1,11 +1,36 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER long1.wang@intel.com ARG swupd_args +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct +RUN swupd update --no-boot-update $swupd_args -RUN swupd update --no-boot-update $swupd_args && \ - swupd bundle-add openstack-common $swupd_args && \ - rm -rf /var/lib/swupd +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,openstack-common --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 / EXPOSE 4369 5671 5672 25672 CMD ["rabbitmq-server"] diff --git a/ruby/Dockerfile b/ruby/Dockerfile index c9ad200..b51b7a3 100644 --- a/ruby/Dockerfile +++ b/ruby/Dockerfile @@ -1,8 +1,35 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER hongzhan.chen@intel.com +ARG swupd_args +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct RUN swupd update --no-boot-update $swupd_args -RUN swupd bundle-add ruby-basic $swupd_args \ - && rm -rf /var/lib/swupd/* + +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,ruby-basic --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 / CMD ["irb"] diff --git a/tensorflow/Dockerfile b/tensorflow/Dockerfile index 6304d94..f5052b3 100644 --- a/tensorflow/Dockerfile +++ b/tensorflow/Dockerfile @@ -1,8 +1,34 @@ -FROM clearlinux:latest +FROM clearlinux:latest AS builder MAINTAINER jianjun.liu@intel.com ARG swupd_args - +# Move to latest Clear Linux release to ensure +# that the swupd command line arguments are +# correct RUN swupd update --no-boot-update $swupd_args -RUN swupd bundle-add machine-learning-tensorflow $swupd_args \ - && rm -rf /var/lib/swupd/* + +# Grab os-release info from the minimal base image so +# that the new content matches the exact OS version +COPY --from=clearlinux/os-core:latest /usr/lib/os-release / + +# Install additional content in a target directory +# using the os version from the minimal base +RUN source /os-release && \ + mkdir /install_root \ + && swupd os-install -V ${VERSION_ID} \ + --path /install_root --statedir /swupd-state \ + --bundles=os-core-update,machine-learning-tensorflow --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 /