-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
58 lines (40 loc) · 1.3 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
57
58
FROM ubuntu:18.04
RUN apt-get update -y && apt-get install -y wget libcurl4-openssl-dev libusb-1.0-0-dev libcurl3-gnutls libicu60
SHELL ["/bin/bash", "--login", "-c"]
ENV NODE_ENV="betanet"
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 14.0.0
WORKDIR $NVM_DIR
# install nvm
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
# install near-shell
RUN npm install -g near-shell
# install go
RUN wget https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz
RUN tar -xvf go1.14.2.linux-amd64.tar.gz
RUN mv go /usr/local
RUN echo 'export GOROOT=/usr/local/go' >> ~/.profile
RUN echo 'export GOPATH=$HOME/go' >> ~/.profile
RUN echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> ~/.profile
RUN source ~/.profile
# build go-warchest
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
WORKDIR /build
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN go build -a -installsuffix cgo -ldflags="-w -s" -o go-warchest .
WORKDIR /dist
RUN cp /build/go-warchest .
EXPOSE 9444
CMD ["/dist/go-warchest"]