Skip to content

Commit f3e4c41

Browse files
committed
Clearlinux script update
1 parent 226b1c9 commit f3e4c41

File tree

2 files changed

+18
-35
lines changed

2 files changed

+18
-35
lines changed

rootfs/clearlinux/Dockerfile

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
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"]

rootfs/gen-rootfs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/bash
2+
#
3+
# Author: Bala Raman <srbala@gmail.com>
4+
#
5+
# Extract/Create RootFS image file from docker image
6+
# ./gen-rootfs image_name filename_subscript
7+
#
28
echo "Setting up temp work dir ..."
39
mkdir -p wsl-temp && cd wsl-temp
410
echo "Saving docker/container image ..."

0 commit comments

Comments
 (0)