add support for DIST1..3

This commit is contained in:
dude 2020-01-31 11:53:42 +07:00
parent 4763710dd4
commit e3def9906f
2 changed files with 41 additions and 10 deletions

View File

@ -8,6 +8,9 @@ RUN \
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
ENV TIMEOUT 12h ENV TIMEOUT 12h
ENV MIRROR_URL http://archive.ubuntu.com/ubuntu ENV MIRROR_URL http://archive.ubuntu.com/ubuntu
ENV DIST1 bionic
ENV DIST2 focal
ENV DIST3 ""
ENV NTHREADS 10 ENV NTHREADS 10
ENV PUID 1000 ENV PUID 1000
ENV PGID 1000 ENV PGID 1000

View File

@ -1,27 +1,55 @@
#!/bin/bash #!/bin/bash
echo "configuring /etc/apt/mirror.list" TARGETFILE="/etc/apt/sources.list"
echo "configuring [$TARGETFILE] MIRROR_URL=[$MIRROR_URL]"
echo " DIST1=[$DIST1] DIST2=[$DIST2]"
echo "#### config #### echo "#### config ####
set base_path /var/www/html/ubuntu set base_path /var/www/html/ubuntu
set nthreads $NTHREADS set nthreads $NTHREADS
set _tilde 0 set _tilde 0" \
> "$TARGETFILE"
deb $MIRROR_URL bionic main restricted universe multiverse if [[ ! -z "$DIST1" ]]; then
deb $MIRROR_URL bionic-updates main restricted universe multiverse echo "# for release $DIST1
deb $MIRROR_URL bionic-backports main restricted universe multiverse deb $MIRROR_URL $DIST1 main restricted universe multiverse
deb $MIRROR_URL bionic-security main restricted universe multiverse deb $MIRROR_URL $DIST1-updates main restricted universe multiverse
deb $MIRROR_URL $DIST1-backports main restricted universe multiverse
deb $MIRROR_URL $DIST1-security main restricted universe multiverse
deb $MIRROR_URL $DIST1-proposed main restricted universe multiverse" >> "$TARGETFILE"
fi
if [[ ! -z "$DIST2" ]]; then
echo "# for release $DIST2
deb $MIRROR_URL $DIST2 main restricted universe multiverse
deb $MIRROR_URL $DIST2-updates main restricted universe multiverse
deb $MIRROR_URL $DIST2-backports main restricted universe multiverse
deb $MIRROR_URL $DIST2-security main restricted universe multiverse
deb $MIRROR_URL $DIST2-proposed main restricted universe multiverse" >> "$TARGETFILE"
fi
if [[ ! -z "$DIST3" ]]; then
echo "# for release $DIST3
deb $MIRROR_URL $DIST3 main restricted universe multiverse
deb $MIRROR_URL $DIST3-updates main restricted universe multiverse
deb $MIRROR_URL $DIST3-backports main restricted universe multiverse
deb $MIRROR_URL $DIST3-security main restricted universe multiverse
deb $MIRROR_URL $DIST3-proposed main restricted universe multiverse" >> "$TARGETFILE"
fi
echo "# for EXTRAS
$EXTRA1 $EXTRA1
$EXTRA2 $EXTRA2
$EXTRA3 $EXTRA3
$EXTRA4 $EXTRA4
$EXTRA5 $EXTRA5
clean http://archive.ubuntu.com/ubuntu" \ clean http://archive.ubuntu.com/ubuntu" >> "$TARGETFILE"
> /etc/apt/mirror.list
echo "content of /etc/apt/mirror.list is..." echo "content of [$TARGETFILE] is..."
echo "-------------------------------------" echo "-------------------------------------"
cat /etc/apt/mirror.list cat "$TARGETFILE"
echo "-------------------------------------" echo "-------------------------------------"
rm -f /var/run/apache2/apache2.pid rm -f /var/run/apache2/apache2.pid