-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
47 lines (37 loc) · 1.27 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
From golang:1.12.9-stretch AS builder
MAINTAINER Chia-An Lee <[email protected]>
ENV GO111MODULE=off
RUN apt-get update
RUN apt-get -y install gcc cmake autoconf libtool pkg-config libmnl-dev libyaml-dev
RUN apt-get clean
# Get Free5GC
RUN cd $GOPATH/src \
&& git clone https://github.com/free5gc/free5gc.git \
&& cd free5gc \
&& git submodule update --init \
&& ./install_env.sh
# Build NF (AMF, AUSF, N3IWF, NRF, NSSF, PCF, SMF, UDM, UDR)
RUN cd $GOPATH/src/free5gc/src \
&& for d in * ; do if [ -f "$d/$d.go" ] ; then go build -o ../bin/"$d" -x "$d/$d.go" ; fi ; done ;
# Build UPF
#RUN go get -u -v "github.com/sirupsen/logrus"
RUN cd $GOPATH/src/free5gc/src/upf \
&& mkdir -p build \
&& cd build \
&& cmake .. \
&& make -j `nproc`
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get -y install netcat tcpdump iproute2 libtool
RUN apt-get clean
WORKDIR /root/free5gc
# Copy AMF, AUSF, N3IWF, NRF, NSSF, PCF, SMF, UDM, UDR
COPY --from=builder /go/src/free5gc/bin/* ./
# Copy UPF
COPY --from=builder /go/src/free5gc/src/upf/build/bin/* ./
# Copy pem key
RUN mkdir -p ../support/TLS
COPY --from=builder /go/src/free5gc/support/TLS/* ../support/TLS/
# Copy log key
RUN mkdir -p ../config
COPY --from=builder /go/src/free5gc/config/free5GC.conf ../config