Newer
Older
# syntax = docker/dockerfile:1.2
FROM golang:1.17-alpine AS installer
WORKDIR /build
RUN apk add --no-cache git make build-base
RUN apk add --update --no-cache alpine-sdk
COPY go.mod .
COPY go.sum .
RUN go mod download
FROM installer as builder
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
GOOS=linux CGO_ENABLED=0 go build -o executor ./cmd/executor/executor.go
FROM alpine
COPY --from=builder /build/executor .
COPY --from=builder /build/cmd/executor/experiment.yaml .
ENTRYPOINT [ "./executor" ]
CMD [""]