From f7f0fd7b37cd772caee3b047d1a760ab0d34a157 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Wed, 7 Feb 2024 13:53:20 -0700 Subject: [PATCH] Initial release --- Dockerfile | 9 +++++++++ build.sh | 6 ++++++ make.sh | 12 ++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 Dockerfile create mode 100755 build.sh create mode 100755 make.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8a6fff0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ubuntu +RUN apt update +RUN apt install -y debootstrap xz-utils +COPY make.sh / +RUN /make.sh +RUN tar -cv sysroot/ > /tmp/sysroot.tar +RUN xz -9 -e -z /tmp/sysroot.tar +RUN mv /tmp/sysroot.tar.xz /tmp/sysroot-`uname -m`.tar.xz +RUN ls -l /tmp/sysroot-`uname -m`.tar.xz diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..5dbabe5 --- /dev/null +++ b/build.sh @@ -0,0 +1,6 @@ +#!/bin/bash +docker build . --platform linux/amd64 -t sysroot_amd64 +docker build . --platform linux/arm64 -t sysroot_arm64 + +docker run --rm -it -v `pwd`:/output/ --platform linux/amd64 -t sysroot_amd64 sh -c "cp /tmp/sysroot-* /output/" +docker run --rm -it -v `pwd`:/output/ --platform linux/arm64 -t sysroot_arm64 sh -c "cp /tmp/sysroot-* /output/" diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..f321ea5 --- /dev/null +++ b/make.sh @@ -0,0 +1,12 @@ +#!/bin/bash +if [[ `uname -m` == "aarch64" ]]; then + debootstrap \ + --include=ca-certificates,curl,file,libc6-dev,make \ + --no-merged-usr --variant=minbase xenial /sysroot \ + http://ports.ubuntu.com/ +else + debootstrap \ + --include=ca-certificates,curl,file,libc6-dev,make \ + --no-merged-usr --variant=minbase xenial /sysroot \ + http://azure.archive.ubuntu.com/ubuntu +fi