mirror of
https://github.com/balkian/mqtt-poc.git
synced 2025-08-29 16:52:22 +00:00
First commit
This commit is contained in:
28
golang/Dockerfile
Normal file
28
golang/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
FROM registry.hub.docker.com/library/golang:1.9
|
||||
|
||||
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && chmod +x /usr/local/bin/dep
|
||||
|
||||
RUN mkdir -p /go/src/mqtt-poc/
|
||||
WORKDIR /go/src/mqtt-poc
|
||||
|
||||
COPY Gopkg.toml Gopkg.lock ./
|
||||
# copies the Gopkg.toml and Gopkg.lock to WORKDIR
|
||||
|
||||
RUN dep ensure -vendor-only
|
||||
|
||||
COPY . /go/src/mqtt-poc
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
||||
|
||||
FROM alpine:latest
|
||||
RUN apk --no-cache add ca-certificates
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
RUN mkdir -p /root/conf
|
||||
|
||||
ADD conf/config.json /root/conf/config.json
|
||||
|
||||
COPY --from=0 /go/src/mqtt-poc/app .
|
||||
|
||||
ENTRYPOINT ["./app"]
|
Reference in New Issue
Block a user