Skip to content

Commit 745704f

Browse files
committed
tweak ARCH to TRIPLET
1 parent d49b001 commit 745704f

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ cd plebnet-playground-docker
4848
***
4949

5050
```sh
51-
ARCH=x86_64-linux-gnu ./install.sh
51+
TRIPLET=x86_64-linux-gnu ./install.sh
5252
```
5353

5454
### Install and start just the `bitcoind`,`lnd` services (comma seperate them)
5555
```sh
56-
ARCH=x86_64-linux-gnu services=bitcoind,lnd ./install.sh
56+
TRIPLET=x86_64-linux-gnu services=bitcoind,lnd ./install.sh
5757
```
5858

5959
### Stop containers

bitcoin-signet/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM debian:buster-slim as builder
22

33
ARG BITCOIN_VERSION=22.0
4-
ARG ARCH=${ARCH}
4+
ARG TRIPLET=${TRIPLET}
55

66

77
#RUN apt-add-repository ppa:bitcoin/bitcoin && apt-get update && apt-get install bitcoin
@@ -13,8 +13,8 @@ RUN apt-get update && \
1313
WORKDIR /tmp
1414

1515
# install bitcoin binaries
16-
RUN BITCOIN_URL="https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${ARCH}.tar.gz" && \
17-
BITCOIN_FILE="bitcoin-${BITCOIN_VERSION}-${ARCH}.tar.gz" && \
16+
RUN BITCOIN_URL="https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TRIPLET}.tar.gz" && \
17+
BITCOIN_FILE="bitcoin-${BITCOIN_VERSION}-${TRIPLET}.tar.gz" && \
1818
BITCOIN_SHA_URL="https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS" && \
1919
wget -qO "${BITCOIN_FILE}" "${BITCOIN_URL}" && wget -qO SHA256SUMS.asc "${BITCOIN_SHA_URL}" && \
2020
grep "${BITCOIN_FILE}" SHA256SUMS.asc | sha256sum -c - && \

btcd/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG ARCH=amd64
1+
ARG TRIPLET=amd64
22
FROM golang:1.14-alpine3.12 AS build-container
33
USER root
44
ENV GO111MODULE=on
@@ -10,9 +10,9 @@ WORKDIR /root/btcd
1010
ARG BTCD_VERSION=63438c6d3661a7dec09013f7731035abdf1eb4bc
1111
RUN git fetch --all && git checkout ${BTCD_VERSION}
1212
RUN set -ex \
13-
&& if [ "${ARCH}" = "amd64" ]; then export GOARCH=amd64; fi \
14-
&& if [ "${ARCH}" = "arm32v7" ]; then export GOARCH=arm; fi \
15-
&& if [ "${ARCH}" = "arm64v8" ]; then export GOARCH=arm64; fi \
13+
&& if [ "${TRIPLET}" = "amd64" ]; then export GOARCH=amd64; fi \
14+
&& if [ "${TRIPLET}" = "arm32v7" ]; then export GOARCH=arm; fi \
15+
&& if [ "${TRIPLET}" = "arm64v8" ]; then export GOARCH=arm64; fi \
1616
&& echo "Compiling for $GOARCH" \
1717
&& go install -v . ./cmd/...
1818

docker-compose.yaml.template

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
context: ./bitcoin-signet
77
dockerfile: Dockerfile
88
args:
9-
- ARCH=${ARCH}
9+
- TRIPLET=${TRIPLET}
1010
image: playground-docker-bitcoind
1111
links:
1212
- tor
@@ -15,7 +15,7 @@ services:
1515
restart: unless-stopped
1616
container_name: playground-bitcoind
1717
environment:
18-
ARCH: ${ARCH}
18+
TRIPLET: ${TRIPLET}
1919
GET_COINS_ON_STARTUP: 'true'
2020
expose:
2121
- "38332"
@@ -35,7 +35,7 @@ services:
3535
- bitcoind
3636
- tor
3737
environment:
38-
ARCH: '${ARCH}'
38+
TRIPLET: '${TRIPLET}'
3939
LND_ALIAS: 'NewNode'
4040
LND_LISTEN: 'playground-lnd:9735'
4141
LND_RPCLISTEN: 'playground-lnd:10009'
@@ -216,12 +216,12 @@ services:
216216
restart: unless-stopped
217217
container_name: playground-docs
218218
environment:
219-
- ARCH=${ARCH}
219+
- TRIPLET=${TRIPLET}
220220
build:
221221
context: ${oc.env:PWD}/docs
222222
dockerfile: Dockerfile
223223
args:
224-
- ARCH=${ARCH}
224+
- TRIPLET=${TRIPLET}
225225
expose:
226226
- "8000"
227227
ports:

install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# if [ -z "$1" ]
22
# then
3-
# echo 'You must provide ARCH as first parameter'
3+
# echo 'You must provide TRIPLET as first parameter'
44
# echo './install.sh x86_64-linux-gnu'
55
# exit;
66
# fi
77

8-
# ARCH=$1
8+
# TRIPLET=$1
99

10-
: ${ARCH:=x86_64-linux-gnu}
10+
: ${TRIPLET:=x86_64-linux-gnu}
1111
: ${services:=Null}
1212

1313
#Remove any old version
1414
docker-compose down
1515

16-
python plebnet_generate.py ARCH=$ARCH services=$services
16+
python plebnet_generate.py TRIPLET=$TRIPLET services=$services
1717

1818
sudo rm -rf volumes
1919

@@ -27,5 +27,5 @@ mkdir volumes/tor_datadir
2727
mkdir volumes/tor_servicesdir
2828
mkdir volumes/tor_torrcdir
2929

30-
docker-compose build --build-arg ARCH=$ARCH
30+
docker-compose build --build-arg TRIPLET=$TRIPLET
3131
docker-compose up --remove-orphans -d

plebnet_generate.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
cli_args = OmegaConf.from_cli()
1919

2020
try:
21-
arch = cli_args['ARCH']
21+
triplet = cli_args['TRIPLET']
2222
except KeyError:
23-
print('Need to supply ARCH. Supported architectures:')
23+
print('Need to supply TRIPLET. Supported architectures:')
2424
for k, v in architectures.items():
25-
print('\t{}: ARCH={}'.format(k, v))
25+
print('\t{}: TRIPLET={}'.format(k, v))
2626
sys.exit()
2727

2828
conf = OmegaConf.load('docker-compose.yaml.template')
2929

3030
# merge in architecture
31-
conf = OmegaConf.merge(OmegaConf.create(dict(ARCH=arch)), conf)
31+
conf = OmegaConf.merge(OmegaConf.create(dict(TRIPLET=triplet)), conf)
3232

3333

3434
if 'services' in cli_args:
@@ -80,15 +80,15 @@ def get_services(services, required_services=set()):
8080
conf.services.pop(service_name)
8181

8282
# dashboard keyword
83-
conf['USE_TEST_DATA'] = cli_args.get('ARCH', False)
83+
conf['USE_TEST_DATA'] = cli_args.get('TRIPLET', False)
8484

8585
try:
8686
OmegaConf.resolve(conf)
8787
except:
8888
print(OmegaConf.to_yaml(conf))
8989
raise
9090

91-
conf.pop('ARCH')
91+
conf.pop('TRIPLET')
9292
conf.pop('USE_TEST_DATA')
9393

9494
with open('docker-compose.yaml', 'w') as f:

0 commit comments

Comments
 (0)