Skip to content

Commit

Permalink
Clearlinux script update
Browse files Browse the repository at this point in the history
  • Loading branch information
srbala committed Dec 19, 2021
1 parent 226b1c9 commit f3e4c41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 35 deletions.
47 changes: 12 additions & 35 deletions rootfs/clearlinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
FROM clearlinux:latest AS system-build

ARG swupd_args
FROM clearlinux:latest AS builder

# Move to latest Clear Linux release
RUN swupd update --no-boot-update $swupd_args
# Install clean os-core bundle in target directory
# using the new os version
RUN source /usr/lib/os-release; \
kdir /install_root; \
swupd os-install \
--bundles=os-core-plus,binutils,sysadmin-basic \
-V ${VERSION_ID} \
--path /install_root --statedir /swupd-state \
--no-boot-update; \
cd /install_root/etc; \
ln -s ../usr/lib/os-release os-release; \
cat os-release | grep PRETTY_NAME | awk -F= '{print $2;}' | awk '{ gsub(/"/, ""); print }' > system-release ;

FROM scratch AS system-build2
#
COPY --from=system-build /install_root /
#
RUN systemctl set-default multi-user.target; \
RUN swupd update --no-boot-update; \
swupd bundle-add sysadmin-basic;
RUN swupd bundle-add binutils; \
swupd bundle-add jq; \
systemctl set-default multi-user.target; \
systemctl mask systemd-remount-fs.service \
dev-hugepages.mount \
sys-fs-fuse-connections.mount \
Expand All @@ -33,17 +17,10 @@ RUN systemctl set-default multi-user.target; \
systemd-random-seed.service \
systemd-machine-id-commit.service
#

FROM scratch
#
COPY --from=system-build . .
#
LABEL MAINTAINER="Bala Raman<[email protected]>"

STOPSIGNAL SIGRTMIN+3
#
CMD ["/sbin/init"]
#
# build image step : docker build --squash -t srbala/wsl:clearlinux .
# test & local run step : docker run --rm -it srbala/wsl:clearlinux /bin/bash
RUN cat /usr/lib/os-release | grep PRETTY_NAME | awk -F= '{print $2;}' | awk '{ gsub(/"/, ""); print }' > /etc/system-release ;
#
COPY scripts/usr/local/ /usr/local
#ß
FROM scratch
COPY --from=builder / /
CMD ["/bin/bash"]
6 changes: 6 additions & 0 deletions rootfs/gen-rootfs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
#
# Author: Bala Raman <[email protected]>
#
# Extract/Create RootFS image file from docker image
# ./gen-rootfs image_name filename_subscript
#
echo "Setting up temp work dir ..."
mkdir -p wsl-temp && cd wsl-temp
echo "Saving docker/container image ..."
Expand Down

0 comments on commit f3e4c41

Please sign in to comment.