forked from omec-project/pfcpsim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 746 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 746 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
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022-present Open Networking Foundation
# Stage pfcpsim-build: builds the pfcpsim docker image
FROM golang:alpine AS builder
WORKDIR /pfcpctl
COPY go.mod ./go.mod
COPY go.sum ./go.sum
RUN go mod download
# exploit local cache
VOLUME $(go env GOCACHE):/root/.cache/go-build
COPY . ./
RUN CGO_ENABLED=0 go build -o /bin/pfcpctl cmd/pfcpctl/main.go
RUN CGO_ENABLED=0 go build -o /bin/pfcpsim cmd/pfcpsim/main.go
# Stage pfcpsim: runtime image of pfcpsim, containing also pfcpctl
FROM alpine AS pfcpsim
RUN apk update && apk add tcpdump
COPY --from=builder /bin/pfcpctl /bin
COPY --from=builder /bin/pfcpsim /bin
RUN echo "export PATH=/bin:${PATH}" >> /root/.bashrc
ENTRYPOINT [ "pfcpsim" ]