use intermediate dockerfile
This commit is contained in:
parent
fd2ccbd453
commit
43dc2d76ae
@ -3,7 +3,7 @@ FROM ubuntu:bionic
|
||||
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
|
||||
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
|
||||
RUN useradd builder && \
|
||||
install -d /build -o builder -g builder
|
||||
|
@ -3,7 +3,7 @@ FROM ubuntu:disco
|
||||
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
|
||||
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
|
||||
RUN useradd builder && \
|
||||
install -d /build -o builder -g builder
|
||||
|
14
Dockerfile.focal
Normal file
14
Dockerfile.focal
Normal file
@ -0,0 +1,14 @@
|
||||
FROM ubuntu:focal
|
||||
|
||||
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
|
||||
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
|
||||
apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
|
||||
RUN useradd builder && \
|
||||
install -d /build -o builder -g builder
|
||||
|
||||
ADD scripts/bootstrap.sh /bootstrap.sh
|
||||
ADD scripts/build.sh /build.sh
|
||||
|
||||
ENTRYPOINT ["/bootstrap.sh"]
|
@ -3,7 +3,7 @@ FROM ubuntu:trusty
|
||||
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
|
||||
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
|
||||
RUN useradd builder && \
|
||||
install -d /build -o builder -g builder
|
||||
|
@ -3,7 +3,7 @@ FROM ubuntu:xenial
|
||||
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
|
||||
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
|
||||
|
||||
RUN useradd builder && \
|
||||
install -d /build -o builder -g builder
|
||||
|
11
build.sh
11
build.sh
@ -4,4 +4,13 @@ VARSFILE=$1
|
||||
|
||||
. src/$VARSFILE
|
||||
|
||||
time docker run -it --rm -e "VARSFILE=$VARSFILE" -v $PWD/src:/src extbuilder-$EXTPYTHON_DIST
|
||||
|
||||
echo "FROM extbuilder-$EXTPYTHON_DIST" > Dockerfile.temp
|
||||
echo "RUN apt-get update && \\" >> Dockerfile.temp
|
||||
echo " DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confold\" $CPYTHON_DEPS" >> Dockerfile.temp
|
||||
|
||||
# build image with just the deps
|
||||
docker build -t extbuilder-${EXTPYTHON_DIST}-deps -f Dockerfile.temp .
|
||||
rm -f Dockerfile.temp
|
||||
|
||||
time docker run -it --rm -e "VARSFILE=$VARSFILE" -v $PWD/src:/src extbuilder-${EXTPYTHON_DIST}-deps
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
RELEASES="trusty xenial bionic disco"
|
||||
RELEASES="trusty xenial bionic focal"
|
||||
|
||||
for release in $RELEASES ; do
|
||||
docker pull ubuntu:${release}
|
||||
docker build -t extbuilder-${release} -f Dockerfile.${release} .
|
||||
done
|
||||
|
@ -5,10 +5,6 @@ ln -s /src/$VARSFILE /tmp/vars.sh
|
||||
. /tmp/vars.sh
|
||||
. /etc/lsb-release #for DISTRIB_CODENAME
|
||||
|
||||
# install deps
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" $CPYTHON_DEPS
|
||||
|
||||
# run the build
|
||||
sudo -Hu builder /build.sh
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user