Skip to content

Commit

Permalink
put mount commands upfront
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarak Ben Youssef committed Jan 11, 2024
1 parent 5eafc19 commit f7d033d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/emulator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ COPY . .

ARG TARGETOS
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "arm64" ] ; then \
--mount=type=ssh \
RUN --mount=type=ssh \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
if [ "$TARGETARCH" = "arm64" ] ; then \
GO111MODULE=on CGO_ENABLED=1 GOOS=$TARGETOS \
GOARCH=$TARGETARCH CC=arm-linux-gnueabi-gcc \
go build -ldflags "-extldflags -static" -o ./app ./cmd/emulator ; \
elif [ "$TARGETARCH" = "amd64" ] ; then \
--mount=type=ssh \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GO111MODULE=on CGO_ENABLED=1 GOOS=$TARGETOS \
GOARCH=$TARGETARCH CC=gcc \
go build -ldflags "-extldflags -static" -o ./app ./cmd/emulator ; \
Expand Down

0 comments on commit f7d033d

Please # to comment.