Skip to content

Commit

Permalink
Add Alpine based Dockerfile
Browse files Browse the repository at this point in the history
To build it:

```
docker build -f Dockerfile.alpine -t <image:tag> .
```

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
  • Loading branch information
wallyqs committed Dec 21, 2018
1 parent f10020e commit 2bc515a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dockerfile.alpine
@@ -0,0 +1,22 @@
FROM golang:1.11-alpine3.8 AS builder

WORKDIR $GOPATH/src/github.com/nats-io/gnatsd

MAINTAINER Waldemar Quevedo <wally@synadia.com>

RUN apk add --update git

COPY . .

RUN CGO_ENABLED=0 go build -v -a -tags netgo -installsuffix netgo -ldflags "-s -w -X github.com/nats-io/gnatsd/server.gitCommit=`git rev-parse --short HEAD`" -o /gnatsd

FROM alpine:3.8

RUN apk add --update ca-certificates

COPY --from=builder /gnatsd /gnatsd

# Expose client, management, cluster and gateway ports
EXPOSE 4222 8222 6222 5222

ENTRYPOINT ["/gnatsd"]

0 comments on commit 2bc515a

Please sign in to comment.