Skip to content

Commit efe40e0

Browse files
authored
Merge pull request #600 from onflow/jribbink/cherry-pick-build
Port Dockerfile build to `release/v0`
2 parents 783d456 + 4d6a380 commit efe40e0

File tree

2 files changed

+11
-56
lines changed

2 files changed

+11
-56
lines changed

cmd/emulator/Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,25 @@ WORKDIR /app
1212
# add the pubkey of github.com to knownhosts, so ssh-agent doesn't bark
1313
RUN mkdir -p /root/.ssh && ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
1414
RUN git config --global 'url.ssh://git@github.com/.insteadOf' https://github.com/
15+
RUN apt-get update && apt-get -y install apt-utils gcc-aarch64-linux-gnu
1516

1617
COPY . .
1718

1819
ARG TARGETOS
1920
ARG TARGETARCH
21+
ENV GO111MODULE=on \
22+
CGO_ENABLED=1 \
23+
CGO_FLAGS="-O2 -D__BLST_PORTABLE__" \
24+
GOOS=$TARGETOS \
25+
GOARCH=$TARGETARCH
2026
RUN --mount=type=ssh \
2127
--mount=type=cache,target=/go/pkg/mod \
2228
--mount=type=cache,target=/root/.cache/go-build \
23-
GO111MODULE=on CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
29+
if [ "$TARGETARCH" = "arm64" ] ; then \
30+
export CC=aarch64-linux-gnu-gcc; \
31+
elif [ "$TARGETARCH" = "amd64" ] ; then \
32+
export CC=x86_64-linux-gnu-gcc; \
33+
fi; \
2434
go build -ldflags "-extldflags -static" -o ./app ./cmd/emulator
2535

2636
## Add the binary to a fresh distroless image

cmd/emulator/Dockerfile.relic

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)