File tree Expand file tree Collapse file tree 6 files changed +69
-12
lines changed
Expand file tree Collapse file tree 6 files changed +69
-12
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ FROM $DOCKER_IMAGE_FROM
77# Build-time platform architecture
88ARG TARGETARCH
99
10+ # Upgrade
11+ RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget adduser && apt-get clean && rm -rf /var/lib/apt/lists/*
12+
1013# Create appuser
1114RUN adduser --no-create-home --disabled-password appuser
1215
1316# Precreate workdir
1417RUN mkdir -p /app/bin
1518
16- # Upgrade
17- RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*
18-
1919# Install cardano-cli
2020ARG CARDANO_NODE_VERSION=10.5.1
2121ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz
Original file line number Diff line number Diff line change 88 ${CARGO} build --release
99 cp ../target/release/mithril-aggregator .
1010
11+ build-ci :
12+ # Check that we are on Linux, then build
13+ if [ " $$ (uname -s)" != " Linux" ]; then \
14+ echo " Error: this target only supports Linux" ; \
15+ exit 1; \
16+ fi ; \
17+ RAW_ARCH=$$(uname -m ) ; \
18+ if [ " $$ RAW_ARCH" = " x86_64" ]; then \
19+ ARCH=" amd64" ; \
20+ elif [ " $$ RAW_ARCH" = " aarch64" ]; then \
21+ ARCH=" arm64" ; \
22+ else \
23+ echo " Error: unsupported architecture $$ RAW_ARCH" ; \
24+ exit 1; \
25+ fi ; \
26+ ${CARGO} build --release; \
27+ mkdir -p ./bin-linux-$$ {ARCH}; \
28+ cp ../target/release/mithril-aggregator ./bin-linux-$$ {ARCH}/mithril-aggregator
29+
1130run : build
1231 ./mithril-aggregator serve
1332
3150docker-build :
3251 cd ../ && docker build -t mithril/mithril-aggregator -f mithril-aggregator/Dockerfile .
3352
34- docker-build-ci : build
53+ docker-build-ci : build-ci
3554 cd ../ && docker build -t mithril/mithril-aggregator -f mithril-aggregator/Dockerfile.ci --build-arg DOCKER_IMAGE_FROM --build-arg CARDANO_NODE_VERSION .
3655
3756docker-run :
Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ FROM $DOCKER_IMAGE_FROM
77# Build-time platform architecture
88ARG TARGETARCH
99
10+ # Upgrade
11+ RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget adduser && apt-get clean && rm -rf /var/lib/apt/lists/*
12+
1013# Create appuser
1114RUN adduser --disabled-password appuser
1215
1316# Precreate workdir
1417RUN mkdir -p /app/bin
1518
16- # Upgrade
17- RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*
18-
1919# Copy the executable
2020COPY mithril-client-cli/bin-linux-$TARGETARCH/mithril-client /app/bin/mithril-client
2121
Original file line number Diff line number Diff line change @@ -13,6 +13,25 @@ build:
1313 ${CARGO} build --release
1414 cp ../target/release/mithril-client .
1515
16+ build-ci :
17+ # Check that we are on Linux, then build
18+ if [ " $$ (uname -s)" != " Linux" ]; then \
19+ echo " Error: this target only supports Linux" ; \
20+ exit 1; \
21+ fi ; \
22+ RAW_ARCH=$$(uname -m ) ; \
23+ if [ " $$ RAW_ARCH" = " x86_64" ]; then \
24+ ARCH=" amd64" ; \
25+ elif [ " $$ RAW_ARCH" = " aarch64" ]; then \
26+ ARCH=" arm64" ; \
27+ else \
28+ echo " Error: unsupported architecture $$ RAW_ARCH" ; \
29+ exit 1; \
30+ fi ; \
31+ ${CARGO} build --release; \
32+ mkdir -p ./bin-linux-$$ {ARCH}; \
33+ cp ../target/release/mithril-client ./bin-linux-$$ {ARCH}/mithril-client
34+
1635run : build
1736 @./mithril-client $(call args,defaultstring)
1837
3958docker-build :
4059 cd ../ && docker build -t mithril/mithril-client -f mithril-client-cli/Dockerfile .
4160
42- docker-build-ci : build
61+ docker-build-ci : build-ci
4362 cd ../ && docker build -t mithril/mithril-client -f mithril-client-cli/Dockerfile.ci --build-arg DOCKER_IMAGE_FROM .
4463
4564docker-run :
Original file line number Diff line number Diff line change @@ -7,15 +7,15 @@ FROM $DOCKER_IMAGE_FROM
77# Build-time platform architecture
88ARG TARGETARCH
99
10+ # Upgrade
11+ RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget adduser && apt-get clean && rm -rf /var/lib/apt/lists/*
12+
1013# Create appuser
1114RUN adduser --no-create-home --disabled-password appuser
1215
1316# Precreate workdir
1417RUN mkdir -p /app/bin
1518
16- # Upgrade
17- RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/*
18-
1919# Install cardano-cli
2020ARG CARDANO_NODE_VERSION=10.5.1
2121ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz
Original file line number Diff line number Diff line change @@ -11,6 +11,25 @@ build:
1111run : build
1212 ./mithril-signer
1313
14+ build-ci :
15+ # Check that we are on Linux, then build
16+ if [ " $$ (uname -s)" != " Linux" ]; then \
17+ echo " Error: this target only supports Linux" ; \
18+ exit 1; \
19+ fi ; \
20+ RAW_ARCH=$$(uname -m ) ; \
21+ if [ " $$ RAW_ARCH" = " x86_64" ]; then \
22+ ARCH=" amd64" ; \
23+ elif [ " $$ RAW_ARCH" = " aarch64" ]; then \
24+ ARCH=" arm64" ; \
25+ else \
26+ echo " Error: unsupported architecture $$ RAW_ARCH" ; \
27+ exit 1; \
28+ fi ; \
29+ ${CARGO} build --release; \
30+ mkdir -p ./bin-linux-$$ {ARCH}; \
31+ cp ../target/release/mithril-signer ./bin-linux-$$ {ARCH}/mithril-signer
32+
1433debug :
1534 ${CARGO} run -- -vvv
1635
3150docker-build :
3251 cd ../ && docker build -t mithril/mithril-signer -f mithril-signer/Dockerfile .
3352
34- docker-build-ci : build
53+ docker-build-ci : build-ci
3554 cd ../ && docker build -t mithril/mithril-signer -f mithril-signer/Dockerfile.ci --build-arg DOCKER_IMAGE_FROM --build-arg CARDANO_NODE_VERSION .
3655
3756docker-run :
You can’t perform that action at this time.
0 commit comments