-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
29 lines (22 loc) · 927 Bytes
/
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
FROM ubuntu:jammy
ENV DEBIAN_FRONTEND=noninteractive
ENV GO_VERSION=1.21.9
RUN apt-get update && apt-get install -y wget git build-essential && \
apt-get clean -y && apt -y autoremove
# Install go
RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && tar -xvf go${GO_VERSION}.linux-amd64.tar.gz && \
mv go /usr/local && rm go${GO_VERSION}.linux-amd64.tar.gz
# ENV GOROOT=/usr/local/go
# ENV GOPATH=/go
ENV PATH=/usr/local/go/bin:$PATH
# Go dependencies for protobuf
RUN apt -y update && apt -y upgrade && apt install --no-install-recommends -y protobuf-compiler curl && \
go install google.golang.org/protobuf/cmd/[email protected] && \
go install google.golang.org/grpc/cmd/[email protected]
# These need to be on the LD_LIBRARY_PATH for the server to find at runtime
WORKDIR /go/src/sniffer
COPY . .
RUN make proto && \
go mod tidy && \
go mod vendor && \
make sniffer