Debian Codegraph @

autopaho/examples/docker/publisher/dockerfile

raw
1 # Compile stage
2 FROM golang:alpine AS build-env
3 ENV CGO_ENABLED 0
4
5 ADD . /pub_src
6
7 # Note that the docker-compose sets the context to the root of the paho.golang module. We do this because otherwise
8 # the publisher would need to be in its own module and import paho.golang (which makes modifying the example difficult)
9 # When using this for other code you do not need to do this! (just import `github.com/eclipse/paho.golang` in your code!)
10 WORKDIR /pub_src/autopaho/examples/docker/publisher
11 RUN go build -gcflags "all=-N -l" -o /pub
12
13 # Final stage
14 FROM scratch
15
16 COPY --from=build-env /pub /
17
18 # Run
19 CMD ["/pub"]