-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
58 lines (43 loc) · 1.51 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
57
58
# syntax=docker/dockerfile:1.12
FROM ubuntu:noble 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.6/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.6/fetch_linux_arm64 --output ./fetch;
chmod +x ./fetch;
fi
EOF
ARG SQNC_VERSION=latest
ARG SQNC_REPO=https://github.com/digicatapult/sqnc-node
RUN <<EOF
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then
./fetch --repo="${SQNC_REPO}" --tag="${SQNC_VERSION}" --release-asset="sqnc-node-.*-x86_64-unknown-linux-gnu.tar.gz" ./;
mkdir ./sqnc-node;
tar -xzf ./sqnc-node-*-x86_64-unknown-linux-gnu.tar.gz -C ./sqnc-node;
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then
./fetch --repo="${SQNC_REPO}" --tag="${SQNC_VERSION}" --release-asset="sqnc-node-.*-aarch64-unknown-linux-gnu.tar.gz" ./;
mkdir ./sqnc-node;
tar -xzf ./sqnc-node-*-aarch64-unknown-linux-gnu.tar.gz -C ./sqnc-node;
fi
EOF
FROM ubuntu:noble AS runtime
RUN <<EOF
apt-get update
apt-get install -y libgcc-11-dev curl
rm -rf /var/lib/apt/lists/*
EOF
RUN mkdir /sqnc-node /data
COPY --from=setup /tmp/sqnc-node /sqnc-node/
WORKDIR /sqnc-node
ENTRYPOINT [ "/sqnc-node/sqnc-node" ]
HEALTHCHECK CMD curl -f http://localhost:9944/health || exit 1
EXPOSE 30333 9615 9944