You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is a common sense that docker build must build an image, currently Dockerfile expects to have precompiled binary in .build instead.
I'm not working with Golang, I don't have toolchain installed and no idea how to use it. It'd be great if instead of copying supposedly existing files Dockerfile would actually build stuff.
UPD: This imperfect version worked for me:
FROM golang:1.19 AS build-stage
WORKDIR /app
COPY . /app
RUN CGO_ENABLED=0 GOOS=linux go build -o /smartctl_exporter
FROM alpine:3
RUN apk add smartmontools
COPY --from=build-stage /smartctl_exporter /bin/smartctl_exporter
EXPOSE 9633
USER nobody
ENTRYPOINT [ "/bin/smartctl_exporter" ]
The text was updated successfully, but these errors were encountered:
It is a common sense that
docker build
must build an image, currentlyDockerfile
expects to have precompiled binary in.build
instead.I'm not working with Golang, I don't have toolchain installed and no idea how to use it. It'd be great if instead of copying supposedly existing files
Dockerfile
would actually build stuff.UPD: This imperfect version worked for me:
The text was updated successfully, but these errors were encountered: