forked from toni-moreno/snmpcollector
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (35 loc) · 1.2 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
# Create snmpcollector-last.tar.gz, which includes the binary
FROM ubuntu:16.04 as build
WORKDIR /app/src/snmpcollector
RUN apt update -y && apt upgrade -y
RUN apt-get install -y locales
RUN apt-get install -y curl git gcc
RUN curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt-get install -y nodejs
RUN curl -O https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz
RUN tar -xvf go1.9.1.linux-amd64.tar.gz -C /usr/local
ENV PATH=$PATH:/usr/local/go/bin
ENV GOROOT=/usr/local/go
ENV GOPATH=/app
ENV PATH=$PATH:$GOROOT/bin
ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH
COPY . /app/src/snmpcollector/
RUN go run build.go setup
# RUN go get github.com/tools/godep
# RUN godep restore
# RUN npm install
# RUN PATH=$(npm bin):$PATH
# RUN npm run build:prod
# RUN npm run build:static
RUN go run build.go build-static
RUN go run build.go pkg-min-tar
# Create the Dockerfile for the SnmpCollector
FROM alpine:latest
COPY --from=build /app/src/snmpcollector/dist/snmpcollector.tar.gz /
RUN tar zxvf snmpcollector.tar.gz -C .
WORKDIR /opt/snmpcollector
COPY ./docker/config.toml ./conf
COPY ./docker/start.sh /
# RUN mkdir ./log
ENTRYPOINT ["/start.sh"]