I have the following Dockerfile
FROM golang:1.19 AS builder
ARG WDIR=myapp
ARG VERSION
COPY . ${WDIR}
WORKDIR ${WDIR}
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -a \
--ldflags="-X main.buildVersion=${VERSION} -s -w" \
-o /myapp
FROM gcr.io/myregistry/base/golang/alpine/1.19:stable
COPY --from=builder /myapp /bin/myapp
CMD ["/bin/myapp"]
This fails the lint with:
hadolint: ./myapp/Dockerfile: withBinaryFile: does not exist (No such file or directory)
The Dockerfile works as expected though