github.com/nsqio/nsq@v1.3.0/Dockerfile (about)

     1  FROM golang:alpine AS build
     2  
     3  RUN apk update && apk add make gcc musl-dev
     4  
     5  RUN mkdir -p /go/src/github.com/nsqio/nsq
     6  COPY    .    /go/src/github.com/nsqio/nsq
     7  WORKDIR      /go/src/github.com/nsqio/nsq
     8  
     9  RUN ./test.sh
    10  RUN CGO_ENABLED=0 make PREFIX=/opt/nsq BLDFLAGS='-ldflags="-s -w"' install
    11  
    12  
    13  FROM alpine:latest
    14  
    15  EXPOSE 4150 4151 4160 4161 4170 4171
    16  
    17  RUN mkdir -p /data
    18  WORKDIR      /data
    19  
    20  # Optional volumes (explicitly configure with "docker run -v ...")
    21  # /data          - used by nsqd for persistent storage across restarts
    22  # /etc/ssl/certs - for SSL Root CA certificates from host
    23  
    24  COPY --from=build /opt/nsq/bin/ /usr/local/bin/
    25  RUN ln -s /usr/local/bin/*nsq* / \
    26   && ln -s /usr/local/bin/*nsq* /bin/