Files
Addlicense/Dockerfile
Will Norris e59616150a fix building docker image
Use go modules instead of dep.  Use two stage build to build a minimal
(4 MB) application image.

Fixes #51 #71 #78
2021-07-27 23:25:45 -07:00

21 lines
345 B
Docker

FROM golang:1.16 AS build
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
# copy source and build
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build .
# make a bare minimal image
FROM scratch
# source to be scanned should be mounted to /src
WORKDIR /src
COPY --from=build /app/addlicense /app/addlicense
ENTRYPOINT ["/app/addlicense"]