-
Notifications
You must be signed in to change notification settings - Fork 144
/
Dockerfile
50 lines (37 loc) · 1.72 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
FROM golang:1.14.4-stretch AS builder
LABEL maintainer="Free5GC <[email protected]>"
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies
RUN apt-get update \
&& apt-get -y install gcc cmake autoconf libtool pkg-config libmnl-dev libyaml-dev apt-transport-https ca-certificates \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y nodejs yarn
# Clean apt cache
RUN apt-get clean
# Get Free5GC
RUN cd $GOPATH/src \
&& git clone --recursive -b v3.1.1 -j `nproc` https://github.com/free5gc/free5gc.git
# Build Free5GC NFs & WebUI
RUN cd $GOPATH/src/free5gc \
&& make all
# Alpine is used for debug purpose. You can use scratch for a smaller footprint.
FROM alpine:3.15
WORKDIR /free5gc
RUN mkdir -p config/TLS/ public
# Copy executables
COPY --from=builder /go/src/free5gc/bin/* ./
COPY --from=builder /go/src/free5gc/NFs/upf/build/bin/* ./
COPY --from=builder /go/src/free5gc/webconsole/bin/webconsole ./webui
# Copy static files (webui frontend)
COPY --from=builder /go/src/free5gc/webconsole/public ./public
# Copy linked libs
COPY --from=builder /go/src/free5gc/NFs/upf/build/updk/src/third_party/libgtp5gnl/lib/libgtp5gnl.so.0 ./
COPY --from=builder /go/src/free5gc/NFs/upf/build/utlt_logger/liblogger.so ./
# Copy configuration files (not used for now)
COPY --from=builder /go/src/free5gc/config/* ./config/
COPY --from=builder /go/src/free5gc/NFs/upf/build/config/* ./config/
# Copy default certificates (not used for now)
COPY --from=builder /go/src/free5gc/config/TLS/* ./config/TLS/