File tree Expand file tree Collapse file tree 2 files changed +11
-56
lines changed Expand file tree Collapse file tree 2 files changed +11
-56
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,25 @@ WORKDIR /app
12
12
# add the pubkey of github.com to knownhosts, so ssh-agent doesn't bark
13
13
RUN mkdir -p /root/.ssh && ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
14
14
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
15
16
16
17
COPY . .
17
18
18
19
ARG TARGETOS
19
20
ARG TARGETARCH
21
+ ENV GO111MODULE=on \
22
+ CGO_ENABLED=1 \
23
+ CGO_FLAGS="-O2 -D__BLST_PORTABLE__" \
24
+ GOOS=$TARGETOS \
25
+ GOARCH=$TARGETARCH
20
26
RUN --mount=type=ssh \
21
27
--mount=type=cache,target=/go/pkg/mod \
22
28
--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; \
24
34
go build -ldflags "-extldflags -static" -o ./app ./cmd/emulator
25
35
26
36
# # Add the binary to a fresh distroless image
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments