-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
100 lines (84 loc) · 3.01 KB
/
Dockerfile
File metadata and controls
100 lines (84 loc) · 3.01 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# vim: ts=4 sw=4 noet:
#==================================================================================
# Copyright (c) 2018-2019 AT&T Intellectual Property.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#==================================================================================
# --------------------------------------------------------------------------------------
# Mnemonic: Dockerfile
# Abstract: This dockerfile is used to create an image that can be used to
# run the E2 Simulator in a container.
#
# Building should be as simple as:
#
# docker build -f Dockerfile -t e2sim:[version]
#
# Date: 27 April 2020
# Author: E. Scott Daniels
# Update: 7 October 2022
# Author: Alexandre Huff
# Abstract: Update this dockerfile to create a single build for the E2 Simulator
# --------------------------------------------------------------------------------------
# the builder has: git, wget, cmake, gcc/g++, make, python2/3.
#
ARG CONTAINER_PULL_REGISTRY=nexus3.o-ran-sc.org:10002
FROM ${CONTAINER_PULL_REGISTRY}/o-ran-sc/bldr-ubuntu20-c-go:1.0.0 as e2sim-base
WORKDIR /playpen
# snarf up E2SIM dependencies, then pull E2SIM package and install
# Dependencies: sctp, libcurl(e2sim-rc)
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
git \
cmake \
libsctp-dev \
autoconf \
automake \
vim \
iputils-ping \
iproute2 \
tcpdump \
libcurl4-openssl-dev \
libcpprest-dev \
&& apt-get clean
#
# build and install the application(s)
#
# We use specific stages for each E2SM (e.g. to build E2SM-KPM create a new stage called e2sim-kpm)
# Stage to build E2SM-RC
FROM e2sim-base AS e2sim-rc
COPY . /playpen/
WORKDIR /playpen/e2sim
# build and install submodule dependencies
RUN git submodule update --init --recursive 3rdparty/prometheus-cpp \
&& cd 3rdparty/prometheus-cpp/ && mkdir build && cd build \
&& cmake .. -DBUILD_SHARED_LIBS=OFF && make -j 4 && make install && ldconfig
RUN git submodule update --init --recursive 3rdparty/nlohmann_json_release
# build and install the e2sim-rc application
RUN mkdir build && \
cd build && \
cmake .. && \
make -j 4 && \
make install
#
# generating the final and smaller image with only the required artifacts
#
FROM ubuntu:20.04
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libcpprest-dev \
&& apt-get clean
COPY --from=e2sim-rc /usr/local/bin/e2sim-rc /usr/local/bin/e2sim-rc
# CMD e2sim-rc 10.110.102.29 -p 36422
CMD sleep 100000000