dfgsdfgdfg
Some checks failed
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / build-rootfs-archives (push) Failing after 10s
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / push-archives-to-repo (push) Has been skipped
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / build-and-push-docker-images (push) Has been skipped
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / generate-changelogs (push) Has been skipped
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / generate-build-info (push) Has been skipped
Some checks failed
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / build-rootfs-archives (push) Failing after 10s
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / push-archives-to-repo (push) Has been skipped
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / build-and-push-docker-images (push) Has been skipped
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / generate-changelogs (push) Has been skipped
Build, Upload RootFS, and Push Docker Images, update changelog, update build info. / generate-build-info (push) Has been skipped
This commit is contained in:
@@ -43,51 +43,9 @@ jobs:
|
||||
|
||||
docker run --rm --privileged \
|
||||
-v "$(pwd)":/output \
|
||||
--env DEBIAN_RELEASE="$version" \
|
||||
-e VERSION="$version" \
|
||||
fithwum/debian-$version-base \
|
||||
bash -euxo pipefail -c '
|
||||
set -e
|
||||
|
||||
ROOTFS_DIR="debian-${DEBIAN_RELEASE}"
|
||||
|
||||
echo "[INFO] Bootstrapping Debian $DEBIAN_RELEASE rootfs..."
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends debootstrap bzip2
|
||||
|
||||
debootstrap --verbose --variant=minbase --components=main,contrib,non-free \
|
||||
--include=apt,ca-certificates --arch=amd64 "$DEBIAN_RELEASE" "$ROOTFS_DIR" \
|
||||
http://deb.debian.org/debian/
|
||||
|
||||
for dir in dev dev/pts proc sys; do
|
||||
mount --bind "/$dir" "$ROOTFS_DIR/$dir"
|
||||
done
|
||||
|
||||
echo "[CHROOT] Configuring Debian system..."
|
||||
chroot "$ROOTFS_DIR" /bin/bash -c "\
|
||||
echo 'APT::Get::Assume-Yes \"true\";' > /etc/apt/apt.conf.d/10-assume_yes && \
|
||||
apt-get update && \
|
||||
apt-get upgrade && \
|
||||
apt-get install --no-install-recommends software-properties-common bash wget curl nano locales && \
|
||||
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && \
|
||||
locale-gen && \
|
||||
update-locale LANG=en_US.UTF-8 && \
|
||||
apt-get remove --purge --allow-remove-essential pinentry-curses whiptail kmod iptables iproute2 dmidecode || true && \
|
||||
apt-get clean && \
|
||||
apt-get install -f && \
|
||||
find /var/lib/apt/lists/ -type f -delete \
|
||||
"
|
||||
|
||||
echo "[INFO] Unmounting system directories (ignore errors)..."
|
||||
for dir in sys proc dev/pts dev; do
|
||||
umount -lf "$ROOTFS_DIR/$dir" 2>/dev/null || true
|
||||
done
|
||||
|
||||
echo "[INFO] Creating compressed base image..."
|
||||
mkdir -p "/output/$DEBIAN_RELEASE"
|
||||
TARBALL="/output/$DEBIAN_RELEASE/debian-${DEBIAN_RELEASE}.tar.bz2"
|
||||
tar -cjf "$TARBALL" -C "$ROOTFS_DIR" .
|
||||
echo "[INFO] Tarball ready for CI to upload: $TARBALL"
|
||||
'
|
||||
/scripts/bootstrap-rootfs.sh
|
||||
done
|
||||
|
||||
- name: List output archives
|
||||
|
||||
13
Dockerfile
13
Dockerfile
@@ -5,17 +5,10 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||
WORKDIR /builder
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
debootstrap wget curl bash ftp-upload dirmngr locales sudo git \
|
||||
debootstrap wget curl bash ftp-upload dirmngr locales sudo git bzip2 \
|
||||
&& apt-get clean
|
||||
|
||||
# Setup locale
|
||||
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
|
||||
locale-gen && \
|
||||
update-locale LANG=en_US.UTF-8
|
||||
COPY base-image-script/ /scripts/
|
||||
RUN chmod +x /scripts/*.sh
|
||||
|
||||
COPY base-image-script/ base-image-script/
|
||||
|
||||
RUN chmod +x base-image-script/*.sh
|
||||
|
||||
# Default command overridden by workflow
|
||||
CMD ["bash"]
|
||||
|
||||
43
scripts/bootstrap-rootfs.sh
Normal file
43
scripts/bootstrap-rootfs.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
DEBIAN_RELEASE=${VERSION:-"buster"}
|
||||
ROOTFS_DIR="debian-${DEBIAN_RELEASE}"
|
||||
|
||||
echo "[INFO] Bootstrapping Debian $DEBIAN_RELEASE rootfs..."
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends debootstrap bzip2
|
||||
|
||||
debootstrap --verbose --variant=minbase --components=main,contrib,non-free \
|
||||
--include=apt,ca-certificates --arch=amd64 "$DEBIAN_RELEASE" "$ROOTFS_DIR" \
|
||||
http://deb.debian.org/debian/
|
||||
|
||||
for dir in dev dev/pts proc sys; do
|
||||
mount --bind "/$dir" "$ROOTFS_DIR/$dir"
|
||||
done
|
||||
|
||||
echo "[CHROOT] Configuring Debian system..."
|
||||
chroot "$ROOTFS_DIR" /bin/bash <<'EOF'
|
||||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/10-assume_yes
|
||||
apt-get update
|
||||
apt-get upgrade
|
||||
apt-get install --no-install-recommends software-properties-common bash wget curl nano locales
|
||||
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen
|
||||
locale-gen
|
||||
update-locale LANG=en_US.UTF-8
|
||||
apt-get remove --purge --allow-remove-essential pinentry-curses whiptail kmod iptables iproute2 dmidecode || true
|
||||
apt-get clean
|
||||
apt-get install -f
|
||||
find /var/lib/apt/lists/ -type f -delete
|
||||
EOF
|
||||
|
||||
echo "[INFO] Unmounting system directories (ignore errors)..."
|
||||
for dir in sys proc dev/pts dev; do
|
||||
umount -lf "$ROOTFS_DIR/$dir" 2>/dev/null || true
|
||||
done
|
||||
|
||||
echo "[INFO] Creating compressed base image..."
|
||||
mkdir -p "/output/$DEBIAN_RELEASE"
|
||||
TARBALL="/output/$DEBIAN_RELEASE/debian-${DEBIAN_RELEASE}.tar.bz2"
|
||||
tar -cjf "$TARBALL" -C "$ROOTFS_DIR" .
|
||||
echo "[INFO] Tarball ready: $TARBALL"
|
||||
Reference in New Issue
Block a user