-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
54 lines (44 loc) · 1.12 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
################
## ODIN Build
#FROM ubuntu:latest as ODINBUILDER
#
#RUN apt-get update && \
# apt-get install -y --no-install-recommends \
# llvm-11 \
# llvm-11-dev \
# git \
# make \
# clang \
# apt-transport-https \
# ca-certificates \
# && rm -rf /var/lib/apt/lists/*
#RUN update-ca-certificates
#
#RUN git clone --depth=1 https://github.com/odin-lang/Odin.git
#RUN cd Odin && make release
###############
# VPBOT Build
FROM golang:latest as builder
ARG GIT_COMMIT=DEV
ARG BUILD_TIME=DEV
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -ldflags "-X main.versionStr=$GIT_COMMIT -X main.buildTimeStr=$BUILD_TIME" -o vpbot .
###############
# VPBOT Runner
FROM ubuntu:latest
WORKDIR /app
LABEL maintainer="Mikkel Hjortshoej <hoej@northwolfprod.com>"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN update-ca-certificates
#COPY --from=ODINBUILDER /Odin/core/ core/
#COPY --from=ODINBUILDER /Odin/odin .
COPY --from=builder /app/vpbot .
ENV PATH="/app:${PATH}"
# Command to run the executable
ENTRYPOINT ["./vpbot"]