Skip to content

Commit

Permalink
Merge pull request #98 from wojiushixiaobai/pr@main@perf_debian_slim
Browse files Browse the repository at this point in the history
perf: 修复 apt_conf 规则不生效
  • Loading branch information
qiangxuhui authored Oct 26, 2023
2 parents dd589a0 + d54f725 commit 907c4bd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions library/debian/buster-slim/make_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ if [ ! -f /usr/share/debootstrap/scripts/$RELEASE ]; then
ln -s /usr/share/debootstrap/scripts/sid /usr/share/debootstrap/scripts/$RELEASE
fi

TMPDIR=$(mktemp -d)

# install packages
debootstrap --no-check-gpg --variant=minbase --components=main,non-free,contrib --arch=loongarch64 --foreign $RELEASE $TMPDIR $MIRROR_ADDRESS
chroot $TMPDIR debootstrap/debootstrap --second-stage

# https://github.com/GoogleContainerTools/base-images-docker/tree/master/debian/reproducible/overlay/etc/apt/apt.conf.d
apt_conf=(
apt-retry
Expand All @@ -28,14 +34,10 @@ for apt_file in ${apt_conf[@]};do
curl -o $TMPDIR/etc/apt/apt.conf.d/${apt_file} -sSL ${APT_CONF_URL}/${apt_file}
done

TMPDIR=`mktemp -d`
# slimify
cp .slimify-includes $TMPDIR/.slimify-includes
cp .slimify-excludes $TMPDIR/.slimify-excludes
# install packages
debootstrap --no-check-gpg --variant=minbase --components=main,non-free,contrib --arch=loongarch64 --foreign $RELEASE $TMPDIR $MIRROR_ADDRESS
chroot $TMPDIR debootstrap/debootstrap --second-stage

# slimify
slimIncludes=( $(sed '/^#/d;/^$/d' .slimify-includes | sort -u) )
slimExcludes=( $(sed '/^#/d;/^$/d' .slimify-excludes | sort -u) )

Expand Down

0 comments on commit 907c4bd

Please sign in to comment.