mirror of
https://github.com/hanzo-ml/katib.git
synced 2026-09-24 00:31:27 +00:00
* 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
25 lines
564 B
Docker
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"]
|