forked from nats-io/nats-box
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 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
FROM golang:1.17-alpine AS builder
LABEL maintainer "Derek Collison <[email protected]>"
LABEL maintainer "Waldemar Quevedo <[email protected]>"
LABEL maintainer "Jaime Piña <[email protected]>"
WORKDIR $GOPATH/src/github.com/nats-io/
RUN apk add -U --no-cache git binutils
RUN go install github.com/nats-io/nats-top@latest
RUN go install -ldflags "-X main.version=2.6.0" github.com/nats-io/[email protected]
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 fetch origin && \
git checkout v0.0.28 && \
go build -ldflags "-s -w -X main.version=0.0.28" -o /nats
RUN go install github.com/nats-io/stan.go/examples/stan-pub@latest
RUN go install github.com/nats-io/stan.go/examples/stan-sub@latest
RUN go install github.com/nats-io/stan.go/examples/stan-bench@latest
# Simple tools
COPY . .
RUN go install
RUN strip /go/bin/*
FROM alpine:3.15
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 XDG_DATA_HOME /nsc
ENV XDG_CONFIG_HOME /nsc/.config
COPY .profile $WORKDIR
ENTRYPOINT ["/bin/sh", "-l"]