diff --git a/docker/gitian-bitcoin-host/Dockerfile b/docker/gitian-bitcoin-host/Dockerfile index 4243d82..77fdaf5 100644 --- a/docker/gitian-bitcoin-host/Dockerfile +++ b/docker/gitian-bitcoin-host/Dockerfile @@ -7,15 +7,10 @@ FROM gdm85/gitian-host-vms MAINTAINER Giuseppe Mazzotta "gdm85@users.noreply.github.com" -RUN apt-get install -y patch - -ADD gitian.patch /home/debian/ - -## patch to allow paralle creation of VMs -RUN cd /home/debian/gitian-builder && patch -F3 -p1 < ../gitian.patch - ADD input-sources/ /home/debian/input-sources/ ADD build-bitcoin.sh /home/debian/ ADD sign.sh /home/debian/ -RUN chown -R debian.debian /home/debian/ +WORKDIR /home/debian + +RUN chown -R debian.debian input-sources build-bitcoin.sh sign.sh diff --git a/docker/gitian-bitcoin-host/build-bitcoin.sh b/docker/gitian-bitcoin-host/build-bitcoin.sh index 43508d1..58cdfee 100755 --- a/docker/gitian-bitcoin-host/build-bitcoin.sh +++ b/docker/gitian-bitcoin-host/build-bitcoin.sh @@ -28,12 +28,12 @@ while read -r URL FNAME; do continue fi echo "wget -q --continue --no-check-certificate '$URL' -O '$FNAME'" -done < ../../input-sources/${VERSION}.txt | parallel -j10 || exit $? +done < ../../input-sources/${VERSION}-inputs.txt | parallel -j10 || exit $? ## verify that all sources are correct before continuing -md5sum -c < ../../input-sources/${VERSION}.txt.md5 && \ +md5sum -c < ../../input-sources/${VERSION}-inputs.md5 && \ cd .. && \ -for DESC in $(<../../input-sources/${VERSION}-descriptors.txt); do +for DESC in $(<../input-sources/${VERSION}-descriptors.txt); do ./bin/gbuild ../bitcoin/contrib/gitian-descriptors/${DESC}.yml && \ mv build/out/*.zip inputs/ || exit $? done && \ diff --git a/docker/gitian-bitcoin-host/gitian.patch b/docker/gitian-bitcoin-host/gitian.patch deleted file mode 100644 index ffcecb7..0000000 --- a/docker/gitian-bitcoin-host/gitian.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/bin/gbuild b/bin/gbuild -index 4e7839f..d1601d3 100755 ---- a/bin/gbuild -+++ b/bin/gbuild -@@ -94,6 +94,8 @@ def build_one_configuration(suite, arch, build_desc, reference_datetime) - File.open("var/build-script", "w") do |script| - script.puts "#!/bin/bash" - script.puts "set -e" -+ script.puts "export LANG='en_US.UTF-8'" -+ script.puts "export LC_ALL='en_US.UTF-8'" - script.puts "export OUTDIR=$HOME/out" - script.puts "GBUILD_BITS=#{bits}" - script.puts "MAKEOPTS=(-j#{@options[:num_procs]})" -diff --git a/bin/make-base-vm b/bin/make-base-vm -index c1920f3..8a44f13 100755 ---- a/bin/make-base-vm -+++ b/bin/make-base-vm -@@ -109,16 +109,3 @@ rm -rf $OUT - sudo vmbuilder kvm ubuntu --rootsize 10240 --arch=$ARCH --suite=$SUITE --addpkg=$addpkg --removepkg=$removepkg --ssh-key=var/id_dsa.pub --ssh-user-key=var - mv $OUT/*.qcow2 $OUT.qcow2 - rm -rf $OUT -- --if [ $LXC = "1" ]; then -- #sudo debootstrap --include=$addpkg --arch=$ARCH $SUITE $OUT-root $MIRROR -- echo Extracting partition for lxc -- qemu-img convert $OUT.qcow2 $OUT.raw -- loop=`sudo kpartx -av $OUT.raw|sed -n '/loop.p1/{s/.*loop\(.\)p1.*/\1/;p}'` -- sudo cp --sparse=always /dev/mapper/loop${loop}p1 $OUT -- sudo chown $USER $OUT -- sudo kpartx -d /dev/loop$loop -- rm -f $OUT.raw -- # bootstrap-fixup is done in libexec/make-clean-vm --fi -- diff --git a/docker/gitian-bitcoin-host/input-sources/0.9.1-inputs.md5 b/docker/gitian-bitcoin-host/input-sources/0.9.1-inputs.md5 index 383fc3a..6bb3193 100644 --- a/docker/gitian-bitcoin-host/input-sources/0.9.1-inputs.md5 +++ b/docker/gitian-bitcoin-host/input-sources/0.9.1-inputs.md5 @@ -1,6 +1,5 @@ d6eef4b4cacb2183f2bf265a5a03a354 boost_1_55_0.tar.bz2 a14a5486d6b4891d2434039a0ed4c5b7 db-4.8.30.NC.tar.gz -29b7065906e2551508a0d7eacd19174e libpng-1.6.8.tar.gz 065bf20a20ebe605c675b7a5aaef340a miniupnpc-1.8.tar.gz de62b43dfcd858e66a74bee1c834e959 openssl-1.0.1g.tar.gz a72001a9067a4c2c4e0e836d0f92ece4 protobuf-2.5.0.tar.bz2 diff --git a/docker/gitian-bitcoin-host/input-sources/0.9.1-inputs.txt b/docker/gitian-bitcoin-host/input-sources/0.9.1-inputs.txt index cd40897..5cd25ce 100644 --- a/docker/gitian-bitcoin-host/input-sources/0.9.1-inputs.txt +++ b/docker/gitian-bitcoin-host/input-sources/0.9.1-inputs.txt @@ -2,7 +2,6 @@ http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.8.tar.gz miniupnpc-1 https://www.openssl.org/source/openssl-1.0.1g.tar.gz openssl-1.0.1g.tar.gz http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz db-4.8.30.NC.tar.gz http://zlib.net/zlib-1.2.8.tar.gz zlib-1.2.8.tar.gz -ftp://ftp.simplesystems.org/pub/png/src/history/libpng16/libpng-1.6.8.tar.gz libpng-1.6.8.tar.gz https://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.bz2 qrencode-3.4.3.tar.bz2 https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2 boost_1_55_0.tar.bz2 https://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz qt-everywhere-opensource-src-5.2.0.tar.gz diff --git a/docker/gitian-bitcoin-host/input-sources/0.9.2rc2-inputs.md5 b/docker/gitian-bitcoin-host/input-sources/0.9.2rc2-inputs.md5 index 94feb98..902a26f 100644 --- a/docker/gitian-bitcoin-host/input-sources/0.9.2rc2-inputs.md5 +++ b/docker/gitian-bitcoin-host/input-sources/0.9.2rc2-inputs.md5 @@ -2,7 +2,6 @@ d6eef4b4cacb2183f2bf265a5a03a354 boost_1_55_0.tar.bz2 efe08e2f3ca478486037b053acd512e9 cdrkit-1.1.11.tar.gz cea2d01b3206e92a8df7b079935c070b clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz a14a5486d6b4891d2434039a0ed4c5b7 db-4.8.30.NC.tar.gz -29b7065906e2551508a0d7eacd19174e libpng-1.6.8.tar.gz 5ef3ba321e6df72d6519b728b292073e miniupnpc-1.9.tar.gz 8d6d684a9430d5cc98a62a5d8fbda8cf openssl-1.0.1h.tar.gz a72001a9067a4c2c4e0e836d0f92ece4 protobuf-2.5.0.tar.bz2 diff --git a/docker/gitian-bitcoin-host/input-sources/0.9.2rc2-inputs.txt b/docker/gitian-bitcoin-host/input-sources/0.9.2rc2-inputs.txt index afdbe19..7a5e13c 100644 --- a/docker/gitian-bitcoin-host/input-sources/0.9.2rc2-inputs.txt +++ b/docker/gitian-bitcoin-host/input-sources/0.9.2rc2-inputs.txt @@ -2,7 +2,6 @@ http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.tar.gz miniupnp https://www.openssl.org/source/openssl-1.0.1h.tar.gz openssl-1.0.1h.tar.gz http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz db-4.8.30.NC.tar.gz http://zlib.net/zlib-1.2.8.tar.gz zlib-1.2.8.tar.gz -ftp://ftp.simplesystems.org/pub/png/src/history/libpng16/libpng-1.6.8.tar.gz libpng-1.6.8.tar.gz https://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.bz2 qrencode-3.4.3.tar.bz2 https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2 boost_1_55_0.tar.bz2 https://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz qt-everywhere-opensource-src-5.2.0.tar.gz diff --git a/docker/gitian-host/Dockerfile b/docker/gitian-host/Dockerfile index 0e3ac13..d4bf645 100644 --- a/docker/gitian-host/Dockerfile +++ b/docker/gitian-host/Dockerfile @@ -25,7 +25,7 @@ RUN dpkg-reconfigure locales && dpkg-reconfigure tzdata ## continue installation of gitian-builder packages RUN echo "deb http://http.debian.net/debian wheezy main contrib non-free" > /etc/apt/sources.list.d/non-free.list -RUN apt-get install -y iptables ca-certificates sudo bridge-utils git python-cheetah qemu-utils parted kpartx ruby apt-cacher-ng lxc parallel +RUN apt-get install -y iptables ca-certificates sudo bridge-utils git python-cheetah qemu-utils parted kpartx ruby apt-cacher-ng lxc parallel patch ## disable password logins, reverse DNS lookups & privilege separation (due to chroot issues on latest docker) RUN sed -i -e 's/^#PasswordAuthentication yes/PasswordAuthentication no/' -e 's/^UsePrivilegeSeparation.*$/UsePrivilegeSeparation no/' /etc/ssh/sshd_config && echo 'UseDNS no' >> /etc/ssh/sshd_config @@ -57,6 +57,11 @@ ADD bash_profile /home/debian/.bash_profile ADD build-base-vms.sh /home/debian/ RUN git clone https://github.com/devrandom/gitian-builder.git --depth=1 + +ADD gitian.patch /home/debian/ + +## patch to allow paralle creation of VMs +RUN cd gitian-builder && patch -p1 < ../gitian.patch RUN chown -R debian.debian .bash_profile . && chown -R apt-cacher-ng.apt-cacher-ng /var/cache/apt-cacher-ng/ ## suggested: run this image with mounted volumes for pre-downloaded inputs and apt-cacher-ng cache diff --git a/docker/gitian-host/build-base-vms.sh b/docker/gitian-host/build-base-vms.sh index beec2c9..50c7141 100755 --- a/docker/gitian-host/build-base-vms.sh +++ b/docker/gitian-host/build-base-vms.sh @@ -1,7 +1,6 @@ #!/bin/bash set -e - source ~/.bash_profile cd gitian-builder diff --git a/docker/gitian-host/gitian.patch b/docker/gitian-host/gitian.patch new file mode 100644 index 0000000..07a05b0 --- /dev/null +++ b/docker/gitian-host/gitian.patch @@ -0,0 +1,25 @@ +diff --git a/bin/make-base-vm b/bin/make-base-vm +index c1920f3..db311dd 100755 +--- a/bin/make-base-vm ++++ b/bin/make-base-vm +@@ -106,19 +106,6 @@ fi + + libexec/config-bootstrap-fixup + rm -rf $OUT +-sudo vmbuilder kvm ubuntu --rootsize 10240 --arch=$ARCH --suite=$SUITE --addpkg=$addpkg --removepkg=$removepkg --ssh-key=var/id_dsa.pub --ssh-user-key=var/id_dsa.pub --mirror=$MIRROR --security-mirror=$SECURITY_MIRROR --dest=$OUT --flavour=$FLAVOUR --firstboot=`pwd`/target-bin/bootstrap-fixup ++env -i LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 sudo vmbuilder kvm ubuntu --rootsize 10240 --arch=$ARCH --suite=$SUITE --addpkg=$addpkg --removepkg=$removepkg --ssh-key=var/id_dsa.pub --ssh-user-key=var/id_dsa.pub --mirror=$MIRROR --security-m + mv $OUT/*.qcow2 $OUT.qcow2 + rm -rf $OUT +- +-if [ $LXC = "1" ]; then +- #sudo debootstrap --include=$addpkg --arch=$ARCH $SUITE $OUT-root $MIRROR +- echo Extracting partition for lxc +- qemu-img convert $OUT.qcow2 $OUT.raw +- loop=`sudo kpartx -av $OUT.raw|sed -n '/loop.p1/{s/.*loop\(.\)p1.*/\1/;p}'` +- sudo cp --sparse=always /dev/mapper/loop${loop}p1 $OUT +- sudo chown $USER $OUT +- sudo kpartx -d /dev/loop$loop +- rm -f $OUT.raw +- # bootstrap-fixup is done in libexec/make-clean-vm +-fi +- diff --git a/docker/scripts/create-gitian-host.sh b/docker/scripts/create-gitian-host.sh index a4e22fc..2c9deda 100755 --- a/docker/scripts/create-gitian-host.sh +++ b/docker/scripts/create-gitian-host.sh @@ -37,8 +37,9 @@ echo "Now building base VMs" && \ IP=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $CID) && \ wait_for_ssh $IP 10 && \ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no debian@$IP ./build-base-vms.sh && \ -docker stop $CID && \ +docker kill $CID && \ docker wait $CID && \ +sleep 3 && \ docker commit $CID gdm85/gitian-host-vms && \ docker rm $CID && \ echo "Gitian host images created successfully!" && \