forked from digicatapult/sqnc-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (42 loc) · 1.44 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# syntax=docker/dockerfile:1.5
FROM ubuntu:jammy AS setup
RUN <<EOF
apt-get update
apt-get install -y curl ca-certificates
rm -rf /var/lib/apt/lists/*
EOF
WORKDIR /tmp/
ARG TARGETPLATFORM
RUN <<EOF
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
curl -L https://github.com/gruntwork-io/fetch/releases/download/v0.4.2/fetch_linux_amd64 --output ./fetch;
chmod +x ./fetch;
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
curl -L https://github.com/gruntwork-io/fetch/releases/download/v0.4.2/fetch_linux_arm64 --output ./fetch;
chmod +x ./fetch;
fi
EOF
ARG DSCP_VERSION=latest
ARG DSCP_REPO=https://github.com/digicatapult/dscp-node
RUN <<EOF
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
./fetch --repo="${DSCP_REPO}" --tag="${DSCP_VERSION}" --release-asset="dscp-node-.*-x86_64-unknown-linux-gnu.tar.gz" ./;
mkdir ./dscp-node;
tar -xzf ./dscp-node-*-x86_64-unknown-linux-gnu.tar.gz -C ./dscp-node;
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
./fetch --repo="${DSCP_REPO}" --tag="${DSCP_VERSION}" --release-asset="dscp-node-.*-aarch64-unknown-linux-gnu.tar.gz" ./;
mkdir ./dscp-node;
tar -xzf ./dscp-node-*-aarch64-unknown-linux-gnu.tar.gz -C ./dscp-node;
fi
EOF
FROM ubuntu:jammy AS runtime
RUN <<EOF
apt-get update
apt-get install -y libgcc-11-dev
rm -rf /var/lib/apt/lists/*
EOF
RUN mkdir /dscp-node /data
COPY --from=setup /tmp/dscp-node /dscp-node/
WORKDIR /dscp-node
ENTRYPOINT [ "/dscp-node/dscp-node" ]
EXPOSE 30333 9933 9944