Skip to content

Commit

Permalink
chore: fix docker builds for arm64 (#2862)
Browse files Browse the repository at this point in the history
<!--
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
  • Loading branch information
Bidon15 committed Oct 19, 2023
1 parent 2c5eef7 commit db16322
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
FROM --platform=$BUILDPLATFORM docker.io/golang:1.21-alpine3.18 as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

ENV CGO_ENABLED=0
ENV GO111MODULE=on

# hadolint ignore=DL3018
RUN apk update && apk add --no-cache \
RUN uname -a && apk update && apk add --no-cache \
bash \
gcc \
git \
Expand All @@ -13,9 +21,11 @@ COPY go.mod go.sum ./
RUN go mod download
COPY . .

RUN make build && make cel-key
RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
make build && make cel-key

FROM --platform=$BUILDPLATFORM docker.io/alpine:3.18.4
FROM docker.io/alpine:3.18.4

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

# hadolint ignore=DL3018
RUN apk update && apk add --no-cache \
RUN uname -a &&\
apk update && apk add --no-cache \
bash \
curl \
jq \
Expand Down

0 comments on commit db16322

Please sign in to comment.