Files
hmq/Dockerfile
chowyu12 bf2b91c535 update: go.mod and go version (#142)
Co-authored-by: zhouyy <zhouyy@ickey.cn>
2022-01-19 11:16:24 +08:00

12 lines
248 B
Docker

FROM golang:1.17 as builder
WORKDIR /go/src/github.com/fhmq/hmq
COPY . .
RUN CGO_ENABLED=0 go build -o hmq -a -ldflags '-extldflags "-static"' .
FROM alpine
WORKDIR /
COPY --from=builder /go/src/github.com/fhmq/hmq/hmq .
EXPOSE 1883
CMD ["/hmq"]