Skip to content

Commit 86967b2

Browse files
committed
Add option to use docker for gitian-build.sh
1 parent e24bf1c commit 86967b2

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

contrib/gitian-build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ url=https://github.com/bitcoin/bitcoin
2121
proc=2
2222
mem=2000
2323
lxc=true
24+
docker=false
2425
osslTarUrl=http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz
2526
osslPatchUrl=https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch
2627
scriptName=$(basename -- "$0")
@@ -48,6 +49,7 @@ Options:
4849
-j Number of processes to use. Default 2
4950
-m Memory to allocate in MiB. Default 2000
5051
--kvm Use KVM instead of LXC
52+
--docker Use Docker instead of LXC
5153
--setup Set up the Gitian building environment. Uses LXC. If you want to use KVM, use the --kvm option. Only works on Debian-based systems (Ubuntu, Debian)
5254
--detach-sign Create the assert file for detached signing. Will not commit anything.
5355
--no-commit Do not commit anything to git
@@ -156,6 +158,16 @@ while :; do
156158
--kvm)
157159
lxc=false
158160
;;
161+
# docker
162+
--docker)
163+
if [[ $lxc = false ]]
164+
then
165+
echo 'Error: cannot have both kvm and docker'
166+
exit 1
167+
fi
168+
lxc=false
169+
docker=true
170+
;;
159171
# Detach sign
160172
--detach-sign)
161173
signProg="true"
@@ -181,6 +193,12 @@ then
181193
export USE_LXC=1
182194
fi
183195

196+
# Setup docker
197+
if [[ $docker = true ]]
198+
then
199+
export USE_DOCKER=1
200+
fi
201+
184202
# Check for OSX SDK
185203
if [[ ! -e "gitian-builder/inputs/MacOSX10.11.sdk.tar.gz" && $osx == true ]]
186204
then
@@ -238,6 +256,10 @@ then
238256
then
239257
sudo apt-get install lxc
240258
bin/make-base-vm --suite trusty --arch amd64 --lxc
259+
elif [[ -n "$USE_DOCKER" ]]
260+
then
261+
sudo apt-get install docker-ce
262+
bin/make-base-vm --suite trusty --arch amd64 --docker
241263
else
242264
bin/make-base-vm --suite trusty --arch amd64
243265
fi

0 commit comments

Comments
 (0)