forked from mit-dci/opencbdc-tctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.agent
More file actions
24 lines (22 loc) · 823 Bytes
/
Copy pathDockerfile.agent
File metadata and controls
24 lines (22 loc) · 823 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
ARG GOLANG_BUILD_IMAGE=golang:1.16
ARG APP_BASE_IMAGE=ubuntu:20.04
FROM $GOLANG_BUILD_IMAGE as build-env
RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y libpcap-dev
RUN mkdir /src
COPY go.mod /src/go.mod
COPY go.sum /src/go.sum
WORKDIR /src
RUN go mod download
COPY . /src
WORKDIR /src/cmd/agent
ARG GIT_COMMIT=dev
ARG GIT_DATE=00000000
RUN go build -ldflags "-X main.GitCommit=$GIT_COMMIT -X main.BuildDate=$GIT_DATE" -o agent
# final stage
FROM $APP_BASE_IMAGE
RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y libpcap-dev build-essential libsfml-dev iproute2 wget cmake python3-pip libgtest-dev lcov git libtool automake clang-tidy
WORKDIR /app
COPY --from=build-env /src/cmd/agent/agent /app/
COPY agent-requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
CMD ./agent