Grab rootfs tarball from Ubuntu git repo
rodzic
1ce2a198d4
commit
88de8baf33
21
Dockerfile
21
Dockerfile
|
@ -1,32 +1,36 @@
|
|||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM alpine:3.19 as rootfs-stage
|
||||
FROM alpine:3.20 as rootfs-stage
|
||||
|
||||
# environment
|
||||
ENV REL=noble
|
||||
ENV ARCH=amd64
|
||||
ENV TAG=dist-noble-amd64-20240429-0b1b11a0
|
||||
|
||||
# install packages
|
||||
RUN \
|
||||
apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
gawk \
|
||||
file \
|
||||
git \
|
||||
tzdata \
|
||||
xz
|
||||
|
||||
# grab base tarball
|
||||
RUN \
|
||||
BUILD_ID=$(curl -sL https://launchpad.net/~cloud-images-release-managers/+livefs/ubuntu/${REL}/ubuntu-oci | awk -F'(+build|+files)' "/+build/ && /$ARCH/ {print \$2}") &&\
|
||||
git clone --depth=1 https://git.launchpad.net/cloud-images/+oci/ubuntu-base -b ${TAG} /build && \
|
||||
cd /build/oci/blobs/sha256 && \
|
||||
for i in ./*; do if $(file -b $i | grep -q 'gzip'); then TARBALL=$i;fi; done && \
|
||||
mkdir /root-out && \
|
||||
curl -o \
|
||||
/rootfs.tar.gz -L \
|
||||
https://launchpad.net/~cloud-images-release-managers/+livefs/ubuntu/${REL}/ubuntu-oci/+build${BUILD_ID}+files/livecd.ubuntu-oci.rootfs.tar.gz && \
|
||||
tar xf \
|
||||
/rootfs.tar.gz -C \
|
||||
${TARBALL} -C \
|
||||
/root-out && \
|
||||
rm -rf \
|
||||
/root-out/var/log/*
|
||||
/root-out/var/log/* \
|
||||
/root-out/home/ubuntu \
|
||||
/root-out/root/{.ssh,.bashrc,.profile} \
|
||||
/build
|
||||
|
||||
# set version for s6 overlay
|
||||
ARG S6_OVERLAY_VERSION="3.1.6.2"
|
||||
|
@ -132,6 +136,7 @@ RUN \
|
|||
/defaults \
|
||||
/lsiopy && \
|
||||
echo "**** cleanup ****" && \
|
||||
userdel ubuntu && \
|
||||
apt-get autoremove && \
|
||||
apt-get clean && \
|
||||
rm -rf \
|
||||
|
|
|
@ -5,28 +5,32 @@ FROM alpine:3.19 as rootfs-stage
|
|||
# environment
|
||||
ENV REL=noble
|
||||
ENV ARCH=arm64
|
||||
ENV TAG=dist-noble-arm64v8-20240429-4129f303
|
||||
|
||||
# install packages
|
||||
RUN \
|
||||
apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
gawk \
|
||||
tzdata \
|
||||
xz
|
||||
apk add --no-cache \
|
||||
bash \
|
||||
curl \
|
||||
file \
|
||||
git \
|
||||
tzdata \
|
||||
xz
|
||||
|
||||
# grab base tarball
|
||||
RUN \
|
||||
BUILD_ID=$(curl -sL https://launchpad.net/~cloud-images-release-managers/+livefs/ubuntu/${REL}/ubuntu-oci | awk -F'(+build|+files)' "/+build/ && /$ARCH/ {print \$2}") &&\
|
||||
git clone --depth=1 https://git.launchpad.net/cloud-images/+oci/ubuntu-base -b ${TAG} /build && \
|
||||
cd /build/oci/blobs/sha256 && \
|
||||
for i in ./*; do if $(file -b $i | grep -q 'gzip'); then TARBALL=$i;fi; done && \
|
||||
mkdir /root-out && \
|
||||
curl -o \
|
||||
/rootfs.tar.gz -L \
|
||||
https://launchpad.net/~cloud-images-release-managers/+livefs/ubuntu/${REL}/ubuntu-oci/+build${BUILD_ID}+files/livecd.ubuntu-oci.rootfs.tar.gz && \
|
||||
tar xf \
|
||||
/rootfs.tar.gz -C \
|
||||
${TARBALL} -C \
|
||||
/root-out && \
|
||||
rm -rf \
|
||||
/root-out/var/log/*
|
||||
/root-out/var/log/* \
|
||||
/root-out/home/ubuntu \
|
||||
/root-out/root/{.ssh,.bashrc,.profile} \
|
||||
/build
|
||||
|
||||
# set version for s6 overlay
|
||||
ARG S6_OVERLAY_VERSION="3.1.6.2"
|
||||
|
@ -137,6 +141,7 @@ RUN \
|
|||
"https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static" && \
|
||||
chmod +x /usr/bin/qemu-aarch64-static && \
|
||||
echo "**** cleanup ****" && \
|
||||
userdel ubuntu && \
|
||||
apt-get autoremove && \
|
||||
apt-get clean && \
|
||||
rm -rf \
|
||||
|
|
Ładowanie…
Reference in New Issue