Files
goldpinger/Dockerfile
Mikolaj Pawlikowski 0715e438b9 Always vendor
Signed-off-by: Mikolaj Pawlikowski <mikolaj@pawlikowski.pl>
2022-02-04 15:01:55 +00:00

31 lines
703 B
Docker

FROM golang:1.15-alpine as builder
ARG TARGETARCH
ARG TARGETOS
ENV GO111MODULE=on
# Install our build tools
RUN apk add --update git make bash
# Get dependencies
WORKDIR /w
COPY go.mod go.sum ./
RUN go mod download
# Build goldpinger
COPY . ./
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make bin/goldpinger
# Create vendor folder
RUN go mod vendor
# Build the asset container, copy over goldpinger
FROM scratch as simple
COPY --from=builder /w/bin/goldpinger /goldpinger
COPY ./static /static
ENTRYPOINT ["/goldpinger", "--static-file-path", "/static"]
# For vendor builds, use the simple build and add the vendor'd files
FROM simple as vendor
COPY --from=builder /w/vendor /goldpinger-vendor-sources