Skip to content

Commit

Permalink
fix: build all binaries for the target OS/ARCH (#49)
Browse files Browse the repository at this point in the history
#### Motivation

Fix the multi-arch builds so that all binaries are built for the target OS/ARCH. Currently, only the `puller` is built for the target.

#### Modifications

- export GOOS and GOARCH within multi-command RUN that builds the binaries

#### Result


Signed-off-by: Travis Johnson <tsjohnso@us.ibm.com>
  • Loading branch information
tjohnson31415 authored May 15, 2023
1 parent b3dcdcc commit 600f092
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ ARG TARGETARCH
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=${TARGETOS:-linux} \
GOARCH=${TARGETARCH:-amd64} \
export GOOS=${TARGETOS:-linux} && \
export GOARCH=${TARGETARCH:-amd64} && \
go build -o puller model-serving-puller/main.go && \
go build -o triton-adapter model-mesh-triton-adapter/main.go && \
go build -o mlserver-adapter model-mesh-mlserver-adapter/main.go && \
Expand Down

0 comments on commit 600f092

Please sign in to comment.