Files
stacks-puppet-node/.github/actions/dockerfiles/Dockerfile.debian-binary
2024-08-13 08:41:35 -07:00

41 lines
1.3 KiB
Docker

FROM --platform=${TARGETPLATFORM} alpine as builder
# Use a small image to download and extract the release archive
ARG TAG
ARG BIN_ARCH
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
ARG REPO
RUN case ${TARGETPLATFORM} in \
linux/amd64/v2) BIN_ARCH=linux-glibc-x64-v2 ;; \
linux/amd64*) BIN_ARCH=linux-glibc-x64 ;; \
linux/arm64*) BIN_ARCH=linux-glibc-arm64 ;; \
linux/arm/v7) BIN_ARCH=linux-glibc-armv7 ;; \
*) exit 1 ;; \
esac \
&& echo "TARGETPLATFORM: $TARGETPLATFORM" \
&& echo "BIN_ARCH: $BIN_ARCH" \
&& echo "wget -q https://github.com/${REPO}/releases/download/${TAG}/${BIN_ARCH}.zip -O /${BIN_ARCH}.zip" \
&& wget -q https://github.com/${REPO}/releases/download/${TAG}/${BIN_ARCH}.zip -O /${BIN_ARCH}.zip \
&& unzip ${BIN_ARCH}.zip -d /out
FROM --platform=${TARGETPLATFORM} debian:bookworm
COPY --from=builder /out/* /bin/
ARG TAG
RUN case "${TAG}" in \
signer-*) \
echo "/bin/stacks-signer run --config /signer-config.toml" > /tmp/command.sh \
;; \
*) \
echo "/bin/stacks-node mainnet" > /tmp/command.sh && \
rm /bin/blockstack-cli /bin/clarity-cli /bin/relay-server /bin/stacks-events /bin/stacks-inspect \
;; \
esac && \
chmod +x /tmp/command.sh
CMD ["sh", "-c", "/tmp/command.sh"]