1- FROM clearlinux:latest AS system-build
2-
3- ARG swupd_args
1+ FROM clearlinux:latest AS builder
42
53# Move to latest Clear Linux release
6- RUN swupd update --no-boot-update $swupd_args
7- # Install clean os-core bundle in target directory
8- # using the new os version
9- RUN source /usr/lib/os-release; \
10- kdir /install_root; \
11- swupd os-install \
12- --bundles=os-core-plus,binutils,sysadmin-basic \
13- -V ${VERSION_ID} \
14- --path /install_root --statedir /swupd-state \
15- --no-boot-update; \
16- cd /install_root/etc; \
17- ln -s ../usr/lib/os-release os-release; \
18- cat os-release | grep PRETTY_NAME | awk -F= '{print $2;}' | awk '{ gsub(/"/, ""); print }' > system-release ;
19-
20- FROM scratch AS system-build2
21- #
22- COPY --from=system-build /install_root /
23- #
24- RUN systemctl set-default multi-user.target; \
4+ RUN swupd update --no-boot-update; \
5+ swupd bundle-add sysadmin-basic;
6+ RUN swupd bundle-add binutils; \
7+ swupd bundle-add jq; \
8+ systemctl set-default multi-user.target; \
259 systemctl mask systemd-remount-fs.service \
2610 dev-hugepages.mount \
2711 sys-fs-fuse-connections.mount \
@@ -33,17 +17,10 @@ RUN systemctl set-default multi-user.target; \
3317 systemd-random-seed.service \
3418 systemd-machine-id-commit.service
3519#
36-
37- FROM scratch
38- #
39- COPY --from=system-build . .
40- #
41- LABEL MAINTAINER="Bala Raman<srbala@gmail.com>"
42-
43- STOPSIGNAL SIGRTMIN+3
44- #
45- CMD ["/sbin/init" ]
46- #
47- # build image step : docker build --squash -t srbala/wsl:clearlinux .
48- # test & local run step : docker run --rm -it srbala/wsl:clearlinux /bin/bash
20+ RUN cat /usr/lib/os-release | grep PRETTY_NAME | awk -F= '{print $2;}' | awk '{ gsub(/"/, ""); print }' > /etc/system-release ;
4921#
22+ COPY scripts/usr/local/ /usr/local
23+ # ß
24+ FROM scratch
25+ COPY --from=builder / /
26+ CMD ["/bin/bash" ]
0 commit comments