mirror of
https://github.com/hanzo-ml/katib.git
synced 2026-10-30 14:46:14 +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
617 B
Docker
25 lines
617 B
Docker
# Build the Katib file metrics collector.
|
|
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 file-metricscollector ./cmd/metricscollector/v1beta1/file-metricscollector
|
|
|
|
# Copy the file metrics collector into a thin image.
|
|
FROM alpine:3.15
|
|
WORKDIR /app
|
|
COPY --from=build-env /go/src/github.com/kubeflow/katib/file-metricscollector .
|
|
ENTRYPOINT ["./file-metricscollector"]
|