Files
Yuki IwaiandGitHub 1f407138d6 Introduce Automatic platform ARGs (#1935)
* introduce Automatic platform ARGs
Automatic platform ARGs: https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope

* use BuildKit in actions test for charmed-katib

* use docker buildx in scripts/v1beta1/build.sh
2022-08-21 02:43:29 +00:00

25 lines
564 B
Docker

# Build the Katib controller.
FROM golang:alpine AS build-env
ARG TARGETARCH
WORKDIR /go/src/github.com/kubeflow/katib
# Download packages.
COPY go.mod .
COPY go.sum .
RUN go mod download -x
# Copy sources.
COPY cmd/ cmd/
COPY pkg/ pkg/
# Build the binary.
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -a -o katib-controller ./cmd/katib-controller/v1beta1
# Copy the controller-manager into a thin image.
FROM alpine:3.15
WORKDIR /app
COPY --from=build-env /go/src/github.com/kubeflow/katib/katib-controller .
ENTRYPOINT ["./katib-controller"]