From b707256963c75c8e61509f5b339ad4a64edaa08a Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 21 Nov 2023 18:48:08 +0800 Subject: docker(debian-dev): try to fix sbuild. --- docker/debian-dev/Dockerfile | 10 +++------- docker/debian-dev/bootstrap/sbuild/setup-sbuild-amd64.bash | 8 ++++++++ docker/debian-dev/bootstrap/sbuild/setup-sbuild-arm64.bash | 8 ++++++++ docker/debian-dev/bootstrap/sbuild/setup-sbuild-base.bash | 5 +++++ docker/debian-dev/bootstrap/sbuild/setup-sbuild.bash | 11 +++++++++++ docker/debian-dev/bootstrap/setup-base.bash | 2 +- docker/debian-dev/bootstrap/setup-dev-tools-arm64.bash | 1 - docker/debian-dev/bootstrap/setup-dev-tools.bash | 4 ++++ docker/debian-dev/bootstrap/setup-sbuild-amd64.bash | 8 -------- docker/debian-dev/bootstrap/setup-sbuild-arm64.bash | 8 -------- docker/debian-dev/bootstrap/setup-sbuild-base.bash | 5 ----- docker/debian-dev/bootstrap/setup.bash | 10 ++++++++++ 12 files changed, 50 insertions(+), 30 deletions(-) create mode 100755 docker/debian-dev/bootstrap/sbuild/setup-sbuild-amd64.bash create mode 100755 docker/debian-dev/bootstrap/sbuild/setup-sbuild-arm64.bash create mode 100755 docker/debian-dev/bootstrap/sbuild/setup-sbuild-base.bash create mode 100755 docker/debian-dev/bootstrap/sbuild/setup-sbuild.bash delete mode 100755 docker/debian-dev/bootstrap/setup-sbuild-amd64.bash delete mode 100755 docker/debian-dev/bootstrap/setup-sbuild-arm64.bash delete mode 100755 docker/debian-dev/bootstrap/setup-sbuild-base.bash create mode 100755 docker/debian-dev/bootstrap/setup.bash (limited to 'docker/debian-dev') diff --git a/docker/debian-dev/Dockerfile b/docker/debian-dev/Dockerfile index e43764e..950e1af 100644 --- a/docker/debian-dev/Dockerfile +++ b/docker/debian-dev/Dockerfile @@ -1,17 +1,13 @@ FROM debian:11 ARG IN_CHINA= +ARG BUILD_FOR_ARCH=amd64 ENV IN_CHINA=${IN_CHINA} +ARG BUILD_FOR_ARCH=${BUILD_FOR_ARCH} ADD bootstrap /bootstrap -RUN /bootstrap/apt-source/setup.bash -RUN /bootstrap/setup-base.bash -RUN /bootstrap/setup-dev-tools.bash -RUN /bootstrap/setup-dev-tools-arm64.bash -RUN /bootstrap/setup-sbuild-base.bash -RUN /bootstrap/setup-sbuild-amd64.bash -RUN /bootstrap/setup-sbuild-arm64.bash +RUN /bootstrap/setup.bash VOLUME [ "/source", "/data" ] CMD [ "bash", "-l" ] diff --git a/docker/debian-dev/bootstrap/sbuild/setup-sbuild-amd64.bash b/docker/debian-dev/bootstrap/sbuild/setup-sbuild-amd64.bash new file mode 100755 index 0000000..9ee08d1 --- /dev/null +++ b/docker/debian-dev/bootstrap/sbuild/setup-sbuild-amd64.bash @@ -0,0 +1,8 @@ +#! /usr/bin/env bash + +set -e + +SBUILD_ARCH="amd64" +SBUILD_DIST="bullseye" + +sbuild-createchroot --include=eatmydata --command-prefix=eatmydata --arch=${SBUILD_ARCH} ${SBUILD_DIST} /srv/chroot/${SBUILD_DIST}-${SBUILD_ARCH}-sbuild "http://$(/bootstrap/apt-source/get-domain.bash)/debian" diff --git a/docker/debian-dev/bootstrap/sbuild/setup-sbuild-arm64.bash b/docker/debian-dev/bootstrap/sbuild/setup-sbuild-arm64.bash new file mode 100755 index 0000000..5feac2d --- /dev/null +++ b/docker/debian-dev/bootstrap/sbuild/setup-sbuild-arm64.bash @@ -0,0 +1,8 @@ +#! /usr/bin/env bash + +set -e + +SBUILD_ARCH="arm64" +SBUILD_DIST="bullseye" + +sbuild-createchroot --include=eatmydata --command-prefix=eatmydata --foreign --arch=${SBUILD_ARCH} ${SBUILD_DIST} /srv/chroot/${SBUILD_DIST}-${SBUILD_ARCH}-sbuild "http://$(/bootstrap/apt-source/get-domain.bash)/debian" diff --git a/docker/debian-dev/bootstrap/sbuild/setup-sbuild-base.bash b/docker/debian-dev/bootstrap/sbuild/setup-sbuild-base.bash new file mode 100755 index 0000000..a200d3f --- /dev/null +++ b/docker/debian-dev/bootstrap/sbuild/setup-sbuild-base.bash @@ -0,0 +1,5 @@ +#! /usr/bin/env bash + +set -e + +apt-get install -y sbuild schroot debootstrap diff --git a/docker/debian-dev/bootstrap/sbuild/setup-sbuild.bash b/docker/debian-dev/bootstrap/sbuild/setup-sbuild.bash new file mode 100755 index 0000000..f260e5d --- /dev/null +++ b/docker/debian-dev/bootstrap/sbuild/setup-sbuild.bash @@ -0,0 +1,11 @@ +#! /usr/bin/env bash + +/bootstrap/sbuild/setup-sbuild-base.bash + +if [[ "$BUILD_FOR_ARCH" == "amd64" ]]; then + /bootstrap/sbuild/setup-sbuild-amd64.bash +fi + +if [[ "$BUILD_FOR_ARCH" == "arm64" ]]; then + /bootstrap/sbuild/setup-sbuild-arm64.bash +fi diff --git a/docker/debian-dev/bootstrap/setup-base.bash b/docker/debian-dev/bootstrap/setup-base.bash index 5b63fbe..58adc1b 100755 --- a/docker/debian-dev/bootstrap/setup-base.bash +++ b/docker/debian-dev/bootstrap/setup-base.bash @@ -2,7 +2,7 @@ set -e +apt-get update apt-get install -y vim less man curl bash-completion rsync cat /bootstrap/bash-profile/bash-completion.bash >> /root/.bash_profile - diff --git a/docker/debian-dev/bootstrap/setup-dev-tools-arm64.bash b/docker/debian-dev/bootstrap/setup-dev-tools-arm64.bash index 4c881aa..5fb7859 100755 --- a/docker/debian-dev/bootstrap/setup-dev-tools-arm64.bash +++ b/docker/debian-dev/bootstrap/setup-dev-tools-arm64.bash @@ -6,4 +6,3 @@ dpkg --add-architecture arm64 apt-get update apt-get install -y crossbuild-essential-arm64 - diff --git a/docker/debian-dev/bootstrap/setup-dev-tools.bash b/docker/debian-dev/bootstrap/setup-dev-tools.bash index 92f59c8..f2426aa 100755 --- a/docker/debian-dev/bootstrap/setup-dev-tools.bash +++ b/docker/debian-dev/bootstrap/setup-dev-tools.bash @@ -12,3 +12,7 @@ for f in /bootstrap/home-dot/*; do filename=$(basename "$f") cp "$f" "/root/.$filename" done + +if [[ "$BUILD_FOR_ARCH" == "arm64" ]]; then + /bootstrap/setup-dev-tools-arm64.bash +fi diff --git a/docker/debian-dev/bootstrap/setup-sbuild-amd64.bash b/docker/debian-dev/bootstrap/setup-sbuild-amd64.bash deleted file mode 100755 index 9ee08d1..0000000 --- a/docker/debian-dev/bootstrap/setup-sbuild-amd64.bash +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/bin/env bash - -set -e - -SBUILD_ARCH="amd64" -SBUILD_DIST="bullseye" - -sbuild-createchroot --include=eatmydata --command-prefix=eatmydata --arch=${SBUILD_ARCH} ${SBUILD_DIST} /srv/chroot/${SBUILD_DIST}-${SBUILD_ARCH}-sbuild "http://$(/bootstrap/apt-source/get-domain.bash)/debian" diff --git a/docker/debian-dev/bootstrap/setup-sbuild-arm64.bash b/docker/debian-dev/bootstrap/setup-sbuild-arm64.bash deleted file mode 100755 index 5feac2d..0000000 --- a/docker/debian-dev/bootstrap/setup-sbuild-arm64.bash +++ /dev/null @@ -1,8 +0,0 @@ -#! /usr/bin/env bash - -set -e - -SBUILD_ARCH="arm64" -SBUILD_DIST="bullseye" - -sbuild-createchroot --include=eatmydata --command-prefix=eatmydata --foreign --arch=${SBUILD_ARCH} ${SBUILD_DIST} /srv/chroot/${SBUILD_DIST}-${SBUILD_ARCH}-sbuild "http://$(/bootstrap/apt-source/get-domain.bash)/debian" diff --git a/docker/debian-dev/bootstrap/setup-sbuild-base.bash b/docker/debian-dev/bootstrap/setup-sbuild-base.bash deleted file mode 100755 index a200d3f..0000000 --- a/docker/debian-dev/bootstrap/setup-sbuild-base.bash +++ /dev/null @@ -1,5 +0,0 @@ -#! /usr/bin/env bash - -set -e - -apt-get install -y sbuild schroot debootstrap diff --git a/docker/debian-dev/bootstrap/setup.bash b/docker/debian-dev/bootstrap/setup.bash new file mode 100755 index 0000000..fac0393 --- /dev/null +++ b/docker/debian-dev/bootstrap/setup.bash @@ -0,0 +1,10 @@ +#! /usr/bin/env bash + +set -e + +/bootstrap/apt-source/setup.bash +/bootstrap/setup-base.bash +/bootstrap/setup-dev-tools.bash +/bootstrap/sbuild/setup-sbuild.bash + +rm -rf /var/lib/apt/lists/* -- cgit v1.2.3