Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker build doesn't work #172

Open
nazar-pc opened this issue Oct 29, 2023 · 0 comments
Open

docker build doesn't work #172

nazar-pc opened this issue Oct 29, 2023 · 0 comments

Comments

@nazar-pc
Copy link
Contributor

nazar-pc commented Oct 29, 2023

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" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant