-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (26 loc) · 754 Bytes
/
Dockerfile
File metadata and controls
35 lines (26 loc) · 754 Bytes
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
# Build image for builder
FROM golang:alpine AS builder
WORKDIR /app
# Set necessary environmet variables needed for our image
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
# Copy and download dependency using go mod
COPY go.mod .
COPY go.sum .
RUN go mod download
# Copy the code into the container
COPY . .
# Build the application
RUN go build -o /app/mstat .
FROM ubuntu:20.04
WORKDIR /app
RUN apt-get update && apt-get install -y wget gawk tzdata binutils && rm -rf /var/lib/apt/lists/*
# Default timezone
ENV TZ='Asia/Seoul'
RUN ln -snf /usr/share/zoninfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
COPY scripts ./scripts
COPY web ./web
COPY --from=builder /app/mstat /app/mstat
ENTRYPOINT [ "/app/mstat" ]