Merge pull request #167 from linuxserver/noble-tarball
Grab rootfs tarball from Ubuntu git repopull/169/head
commit
13379f02f8
28
Dockerfile
28
Dockerfile
|
@ -1,32 +1,43 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM alpine:3.19 as rootfs-stage
|
FROM alpine:3.20 as rootfs-stage
|
||||||
|
|
||||||
# environment
|
# environment
|
||||||
ENV REL=noble
|
ENV REL=noble
|
||||||
ENV ARCH=amd64
|
ENV ARCH=amd64
|
||||||
|
ENV TAG=oci-noble-24.04
|
||||||
|
|
||||||
# install packages
|
# install packages
|
||||||
RUN \
|
RUN \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
curl \
|
curl \
|
||||||
gawk \
|
git \
|
||||||
|
jq \
|
||||||
tzdata \
|
tzdata \
|
||||||
xz
|
xz
|
||||||
|
|
||||||
# grab base tarball
|
# grab base tarball
|
||||||
RUN \
|
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 && \
|
||||||
|
DIGEST=$(jq -r '.manifests[0].digest[7:]' < index.json) && \
|
||||||
|
cd /build/oci/blobs/sha256 && \
|
||||||
|
if jq -e '.layers // empty' < "${DIGEST}" >/dev/null 2>&1; then \
|
||||||
|
TARBALL=$(jq -r '.layers[0].digest[7:]' < ${DIGEST}); \
|
||||||
|
else \
|
||||||
|
MULTIDIGEST=$(jq -r ".manifests[] | select(.platform.architecture == \"${ARCH}\") | .digest[7:]" < ${DIGEST}) && \
|
||||||
|
TARBALL=$(jq -r '.layers[0].digest[7:]' < ${MULTIDIGEST}); \
|
||||||
|
fi && \
|
||||||
mkdir /root-out && \
|
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 \
|
tar xf \
|
||||||
/rootfs.tar.gz -C \
|
${TARBALL} -C \
|
||||||
/root-out && \
|
/root-out && \
|
||||||
rm -rf \
|
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
|
# set version for s6 overlay
|
||||||
ARG S6_OVERLAY_VERSION="3.1.6.2"
|
ARG S6_OVERLAY_VERSION="3.1.6.2"
|
||||||
|
@ -132,6 +143,7 @@ RUN \
|
||||||
/defaults \
|
/defaults \
|
||||||
/lsiopy && \
|
/lsiopy && \
|
||||||
echo "**** cleanup ****" && \
|
echo "**** cleanup ****" && \
|
||||||
|
userdel ubuntu && \
|
||||||
apt-get autoremove && \
|
apt-get autoremove && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf \
|
rm -rf \
|
||||||
|
|
|
@ -1,32 +1,43 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM alpine:3.19 as rootfs-stage
|
FROM alpine:3.20 as rootfs-stage
|
||||||
|
|
||||||
# environment
|
# environment
|
||||||
ENV REL=noble
|
ENV REL=noble
|
||||||
ENV ARCH=arm64
|
ENV ARCH=arm64
|
||||||
|
ENV TAG=oci-noble-24.04
|
||||||
|
|
||||||
# install packages
|
# install packages
|
||||||
RUN \
|
RUN \
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
bash \
|
bash \
|
||||||
curl \
|
curl \
|
||||||
gawk \
|
git \
|
||||||
|
jq \
|
||||||
tzdata \
|
tzdata \
|
||||||
xz
|
xz
|
||||||
|
|
||||||
# grab base tarball
|
# grab base tarball
|
||||||
RUN \
|
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 && \
|
||||||
|
DIGEST=$(jq -r '.manifests[0].digest[7:]' < index.json) && \
|
||||||
|
cd /build/oci/blobs/sha256 && \
|
||||||
|
if jq -e '.layers // empty' < "${DIGEST}" >/dev/null 2>&1; then \
|
||||||
|
TARBALL=$(jq -r '.layers[0].digest[7:]' < ${DIGEST}); \
|
||||||
|
else \
|
||||||
|
MULTIDIGEST=$(jq -r ".manifests[] | select(.platform.architecture == \"${ARCH}\") | .digest[7:]" < ${DIGEST}) && \
|
||||||
|
TARBALL=$(jq -r '.layers[0].digest[7:]' < ${MULTIDIGEST}); \
|
||||||
|
fi && \
|
||||||
mkdir /root-out && \
|
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 \
|
tar xf \
|
||||||
/rootfs.tar.gz -C \
|
${TARBALL} -C \
|
||||||
/root-out && \
|
/root-out && \
|
||||||
rm -rf \
|
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
|
# set version for s6 overlay
|
||||||
ARG S6_OVERLAY_VERSION="3.1.6.2"
|
ARG S6_OVERLAY_VERSION="3.1.6.2"
|
||||||
|
@ -137,6 +148,7 @@ RUN \
|
||||||
"https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static" && \
|
"https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static" && \
|
||||||
chmod +x /usr/bin/qemu-aarch64-static && \
|
chmod +x /usr/bin/qemu-aarch64-static && \
|
||||||
echo "**** cleanup ****" && \
|
echo "**** cleanup ****" && \
|
||||||
|
userdel ubuntu && \
|
||||||
apt-get autoremove && \
|
apt-get autoremove && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf \
|
rm -rf \
|
||||||
|
|
Ładowanie…
Reference in New Issue