Skip to content

Commit

Permalink
(3847) - Adding/updating Dockerfiles for ARM arch
Browse files Browse the repository at this point in the history
  • Loading branch information
wileyj committed Dec 1, 2023
1 parent b70dd00 commit b3de84a
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/actions/dockerfiles/Dockerfile.alpine-binary
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
ARG REPO=stacks-network/stacks-blockchain
ARG REPO=stacks-network/stacks-core

RUN case ${TARGETARCH} in \
"amd64") BIN_ARCH=linux-musl-x64 ;; \
"arm64") BIN_ARCH=linux-musl-arm64 ;; \
"arm") BIN_ARCH=linux-musl-armv7 ;; \
"*") exit 1 ;; \
esac \
&& echo "wget -q https://github.com/${REPO}/releases/download/${TAG}/${BIN_ARCH}.zip -O /${BIN_ARCH}.zip" \
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/dockerfiles/Dockerfile.debian-binary
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
ARG REPO=stacks-network/stacks-blockchain
ARG REPO=stacks-network/stacks-core

RUN case ${TARGETARCH} in \
"amd64") BIN_ARCH=linux-musl-x64 ;; \
"arm64") BIN_ARCH=linux-musl-arm64 ;; \
"arm") BIN_ARCH=linux-musl-armv7 ;; \
"*") exit 1 ;; \
esac \
&& echo "wget -q https://github.com/${REPO}/releases/download/${TAG}/${BIN_ARCH}.zip -O /${BIN_ARCH}.zip" \
Expand Down
1 change: 1 addition & 0 deletions build-scripts/Dockerfile.linux-glibc-arm64
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ RUN --mount=type=tmpfs,target=${BUILD_DIR} cp -R /src/. ${BUILD_DIR}/ \

FROM scratch AS export-stage
COPY --from=build /out/stacks-inspect /out/blockstack-cli /out/clarity-cli /out/stacks-node /
## comment
26 changes: 26 additions & 0 deletions build-scripts/Dockerfile.linux-glibc-armv7
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM rust:bullseye as build

ARG STACKS_NODE_VERSION="No Version Info"
ARG GIT_BRANCH='No Branch Info'
ARG GIT_COMMIT='No Commit Info'
ARG BUILD_DIR=/build
ARG TARGET=armv7-unknown-linux-gnueabihf
WORKDIR /src

COPY . .

RUN apt-get update && apt-get install -y git gcc-arm-linux-gnueabihf

# Run all the build steps in ramdisk in an attempt to speed things up
RUN --mount=type=tmpfs,target=${BUILD_DIR} cp -R /src/. ${BUILD_DIR}/ \
&& cd ${BUILD_DIR} \
&& rustup target add ${TARGET} \
&& CC=arm-linux-gnueabihf-gcc \
CC_armv7_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
cargo build --features monitoring_prom,slog_json --release --workspace --target ${TARGET} \
&& mkdir -p /out \
&& cp -R ${BUILD_DIR}/target/${TARGET}/release/. /out

FROM scratch AS export-stage
COPY --from=build /out/stacks-inspect /out/blockstack-cli /out/clarity-cli /out/stacks-node /
1 change: 1 addition & 0 deletions build-scripts/Dockerfile.linux-glibc-x64
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ RUN --mount=type=tmpfs,target=${BUILD_DIR} cp -R /src/. ${BUILD_DIR}/ \

FROM scratch AS export-stage
COPY --from=build /out/stacks-inspect /out/blockstack-cli /out/clarity-cli /out/stacks-node /
## comment
21 changes: 21 additions & 0 deletions build-scripts/Dockerfile.linux-musl-armv7
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM messense/rust-musl-cross:armv7-musleabihf as build

ARG STACKS_NODE_VERSION="No Version Info"
ARG GIT_BRANCH='No Branch Info'
ARG GIT_COMMIT='No Commit Info'
ARG BUILD_DIR=/build
ARG TARGET=armv7-unknown-linux-musleabihf
WORKDIR /src

COPY . .

# Run all the build steps in ramdisk in an attempt to speed things up
RUN --mount=type=tmpfs,target=${BUILD_DIR} cp -R /src/. ${BUILD_DIR}/ \
&& cd ${BUILD_DIR} \
&& rustup target add ${TARGET} \
&& cargo build --features monitoring_prom,slog_json --release --workspace --target ${TARGET} \
&& mkdir -p /out \
&& cp -R ${BUILD_DIR}/target/${TARGET}/release/. /out

FROM scratch AS export-stage
COPY --from=build /out/stacks-inspect /out/blockstack-cli /out/clarity-cli /out/stacks-node /
4 changes: 4 additions & 0 deletions build-scripts/build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ case $DIST_TARGET_FILTER in
case $DIST_TARGET_FILTER in
linux-glibc-x64) build_platform linux-glibc-x64 ;;
linux-glibc-arm64) build_platform linux-glibc-arm64 ;;
linux-glibc-armv7) build_platform linux-glibc-armv7 ;;
linux-musl-x64) build_platform linux-musl-x64 ;;
linux-musl-arm64) build_platform linux-musl-arm64 ;;
linux-musl-armv7) build_platform linux-musl-armv7 ;;
windows-x64) build_platform windows-x64 ;;
macos-x64) build_platform macos-x64 ;;
macos-arm64) build_platform macos-arm64 ;;
Expand All @@ -32,8 +34,10 @@ case $DIST_TARGET_FILTER in
echo "Building distrubtions for all targets."
build_platform linux-glibc-x64
build_platform linux-glibc-arm64
build_platform linux-glibc-armv7
build_platform linux-musl-x64
build_platform linux-musl-arm64
build_platform linux-musl-armv7
build_platform windows-x64
build_platform macos-x64
build_platform macos-arm64
Expand Down

0 comments on commit b3de84a

Please sign in to comment.