Skip to content

Commit db16322

Browse files
authored
chore: fix docker builds for arm64 (celestiaorg#2862)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. --> ## Overview Now, this is finally fixed Ref: rollkit/local-celestia-devnet#63 Closes celestiaorg/devops#527 <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. --> ## Checklist <!-- Please complete the checklist to ensure that the PR is ready to be reviewed. IMPORTANT: PRs should be left in Draft until the below checklist is completed. --> - [ ] New and updated code has appropriate documentation - [ ] New and updated code has new and/or updated testing - [ ] Required CI checks are passing - [ ] Visual proof for any user facing features like CLI or documentation updates - [ ] Linked issues closed with keywords
1 parent 2c5eef7 commit db16322

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Dockerfile

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21-alpine3.18 as builder
22

3+
ARG TARGETPLATFORM
4+
ARG BUILDPLATFORM
5+
ARG TARGETOS
6+
ARG TARGETARCH
7+
8+
ENV CGO_ENABLED=0
9+
ENV GO111MODULE=on
10+
311
# hadolint ignore=DL3018
4-
RUN apk update && apk add --no-cache \
12+
RUN uname -a && apk update && apk add --no-cache \
513
bash \
614
gcc \
715
git \
@@ -13,9 +21,11 @@ COPY go.mod go.sum ./
1321
RUN go mod download
1422
COPY . .
1523

16-
RUN make build && make cel-key
24+
RUN uname -a &&\
25+
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
26+
make build && make cel-key
1727

18-
FROM --platform=$BUILDPLATFORM docker.io/alpine:3.18.4
28+
FROM docker.io/alpine:3.18.4
1929

2030
# Read here why UID 10001: https://github.com/hexops/dockerfile/blob/main/README.md#do-not-use-a-uid-below-10000
2131
ARG UID=10001
@@ -28,7 +38,8 @@ ENV NODE_TYPE bridge
2838
ENV P2P_NETWORK mocha
2939

3040
# hadolint ignore=DL3018
31-
RUN apk update && apk add --no-cache \
41+
RUN uname -a &&\
42+
apk update && apk add --no-cache \
3243
bash \
3344
curl \
3445
jq \

0 commit comments

Comments
 (0)