forked from nats-io/nats-box
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (38 loc) · 1.38 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM golang:1.16-alpine AS builder
LABEL maintainer "Derek Collison <derek@nats.io>"
LABEL maintainer "Waldemar Quevedo <wally@nats.io>"
LABEL maintainer "Jaime Piña <jaime@nats.io>"
ENV NATS_CLI_VERSION "0.0.24"
WORKDIR $GOPATH/src/github.com/nats-io/
RUN apk add -U --no-cache git binutils
RUN go get github.com/nats-io/nats-top
RUN go get -u -ldflags "-X main.version=$(date +%Y%m%d)" github.com/nats-io/nsc@master
RUN mkdir -p src/github.com/nats-io && \
cd src/github.com/nats-io/ && \
git clone https://github.com/nats-io/natscli.git && \
cd natscli/nats && \
git checkout ${NATS_CLI_VERSION} && \
go build -ldflags "-s -w -X main.version=$(date +%Y%m%d)" -o /nats
RUN go get github.com/nats-io/stan.go/examples/stan-pub
RUN go get github.com/nats-io/stan.go/examples/stan-sub
RUN go get github.com/nats-io/stan.go/examples/stan-bench
# Simple tools
COPY . .
RUN go install
RUN strip /go/bin/*
FROM alpine:3.13
RUN apk add -U --no-cache ca-certificates figlet
COPY --from=builder /go/bin/* /usr/local/bin/
COPY --from=builder /nats /usr/local/bin/
RUN cd /usr/local/bin/ && \
ln -s nats-box nats-pub && \
ln -s nats-box nats-sub && \
ln -s nats-box nats-req && \
ln -s nats-box nats-rply
WORKDIR /root
USER root
ENV NKEYS_PATH /nsc/nkeys
ENV NSC_HOME /nsc/accounts
ENV NATS_CONFIG_HOME /nsc/config
COPY .profile $WORKDIR
ENTRYPOINT ["/bin/sh", "-l"]