Commit 49bb9590 authored by Raphael Defosseux's avatar Raphael Defosseux

DOCKER: adding dockerfile for Ubuntu18

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 1bcc63fa
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (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.openairinterface.org/?page_id=698
# *
# * 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.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
#---------------------------------------------------------------------
#
# Dockerfile for the Open-Air-Interface AUSF service
# Valid for Ubuntu-18.04 (bionic)
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# BUILDER IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-ausf-builder
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
git \
&& rm -rf /var/lib/apt/lists/*
# Some GIT configuration command quite useful
RUN /bin/bash -c "if [[ -v NEEDED_GIT_PROXY ]]; then git config --global http.proxy $NEEDED_GIT_PROXY; fi"
RUN git config --global https.postBuffer 123289600 && \
git config --global http.sslverify false
# Copying source code
WORKDIR /openair-ausf
COPY . /openair-ausf
# Installing and Building AUSF
WORKDIR /openair-ausf/build/scripts
RUN ./build_ausf --install-deps --force
RUN ./build_ausf --clean --Verbose --build-type Release --jobs
#---------------------------------------------------------------------
# TARGET IMAGE
#---------------------------------------------------------------------
FROM ubuntu:bionic as oai-ausf
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Paris
# We install some debug tools for the moment in addition of mandatory libraries
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
psmisc \
net-tools \
tzdata \
bc \
tshark \
libasan4 \
libnghttp2-14 \
libhogweed4 \
libconfig++9v5 \
libcurl4-gnutls-dev \
&& rm -rf /var/lib/apt/lists/*
# Copying executable and generated libraries
WORKDIR /openair-ausf/bin
COPY --from=oai-ausf-builder /openair-ausf/build/ausf/build/ausf oai_ausf
COPY --from=oai-ausf-builder /openair-ausf/scripts/entrypoint.sh .
COPY --from=oai-ausf-builder /usr/local/lib/libpistache.so /usr/local/lib/
COPY --from=oai-ausf-builder /usr/lib/x86_64-linux-gnu/libnettle.so.6 /usr/local/lib/
RUN ldconfig
WORKDIR /openair-ausf/etc
COPY --from=oai-ausf-builder /openair-ausf/etc/ausf.conf .
WORKDIR /openair-ausf
ENTRYPOINT ["/bin/bash","/openair-ausf/bin/entrypoint.sh"]
CMD ["/openair-ausf/bin/oai_ausf", "-c" , "/openair-ausf/etc/ausf.conf", "-o"]
## AUSF configuration file
AUSF =
{
INSTANCE_ID = 10;
PID_DIRECTORY = "/var/run";
AUSF_NAME = "OAI-AUSF";
INSTANCE_ID = @INSTANCE_ID@;
PID_DIRECTORY = "@PID_DIR@";
AUSF_NAME = "@AUSF_NAME@";
INTERFACES:{
# AUSF binded interface for SBI interface (e.g., communication with AMF, UDM)
SBI:{
INTERFACE_NAME = "eth0"; # YOUR NETWORK CONFIG HERE
INTERFACE_NAME = "@SBI_IF_NAME@"; # YOUR NETWORK CONFIG HERE
IPV4_ADDRESS = "read";
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
PORT = @SBI_PORT@; # YOUR NETWORK CONFIG HERE (default: 80)
PPID = 60;
};
};
# UDM Information
UDM:{
IPV4_ADDRESS = "192.168.66.8"; # YOUR NETWORK CONFIG HERE
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR AMF API VERSION FOR UDM CONFIG HERE
IPV4_ADDRESS = "@UDM_IP_ADDRESS@"; # YOUR NETWORK CONFIG HERE
PORT = @UDM_PORT@; # YOUR NETWORK CONFIG HERE (default: 80)
API_VERSION = "@UDM_VERSION_NB@"; # YOUR AMF API VERSION FOR UDM CONFIG HERE
};
# AMF Information
AMF:{
IPV4_ADDRESS = "192.168.66.2"; # YOUR NETWORK CONFIG HERE (default: 80)
PORT = 80; # YOUR NETWORK CONFIG HERE (default: 80)
API_VERSION = "v1"; # YOUR AMF API VERSION FOR UDM CONFIG HERE
IPV4_ADDRESS = "@AMF_IP_ADDRESS@"; # YOUR NETWORK CONFIG HERE (default: 80)
PORT = @AMF_PORT@; # YOUR NETWORK CONFIG HERE (default: 80)
API_VERSION = "@AMF_VERSION_NB@"; # YOUR AMF API VERSION FOR UDM CONFIG HERE
};
};
INSTANCE_ID=10
PID_DIR=/var/run
AUSF_NAME=OAI-AUSF
SBI_IF_NAME=eth0
UDM_IP_ADDRESS=192.168.66.8
UDM_VERSION_NB=v1
AMF_IP_ADDRESS=192.168.66.2
AMF_VERSION_NB=v1
#!/bin/bash
set -euo pipefail
CONFIG_DIR="/openair-ausf/etc"
SBI_PORT=${SBI_PORT:-80}
UDM_PORT=${UDM_PORT:-80}
AMF_PORT=${AMF_PORT:-80}
for c in ${CONFIG_DIR}/*.conf; do
# grep variable names (format: ${VAR}) from template to be rendered
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
# create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR"
EXPRESSIONS=""
for v in ${VARS}; do
NEW_VAR=`echo $v | sed -e "s#@##g"`
if [[ "${!NEW_VAR}x" == "x" ]]; then
echo "Error: Environment variable '${NEW_VAR}' is not set." \
"Config file '$(basename $c)' requires all of $VARS."
exit 1
fi
EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
done
EXPRESSIONS="${EXPRESSIONS#';'}"
# render template and inline replace config file
sed -i "${EXPRESSIONS}" ${c}
done
exec "$@"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment