Commit 160dc286 authored by sagar arora's avatar sagar arora

update dockerfile ubuntu,rhel amf.conf

parent 66f49b19
...@@ -121,7 +121,7 @@ COPY --from=oai-amf-builder /openair-amf/scripts/entrypoint.sh entrypoint.sh ...@@ -121,7 +121,7 @@ COPY --from=oai-amf-builder /openair-amf/scripts/entrypoint.sh entrypoint.sh
# Copying template configuration files # Copying template configuration files
WORKDIR /openair-amf/etc WORKDIR /openair-amf/etc
COPY --from=oai-amf-builder /openair-amf/etc/amf.conf . COPY --from=oai-amf-builder /openair-amf/etc/amf.conf .
COPY --from=oai-amf-builder /openair-amf/etc/modules.conf . #COPY --from=oai-amf-builder /openair-amf/etc/modules.conf .
WORKDIR /openair-amf WORKDIR /openair-amf
...@@ -129,7 +129,7 @@ WORKDIR /openair-amf ...@@ -129,7 +129,7 @@ WORKDIR /openair-amf
EXPOSE 80/tcp 9090/tcp 38412/sctp EXPOSE 80/tcp 9090/tcp 38412/sctp
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"] CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
ENTRYPOINT ["/openair-amf/bin/entrypoint.sh"]
#CMD ["sleep", "infinity"]
ENTRYPOINT ["/openair-amf/bin/entrypoint.sh"]
#CMD ["sleep", "infinity"]
\ No newline at end of file
...@@ -47,7 +47,7 @@ RUN git config --global https.postBuffer 123289600 ...@@ -47,7 +47,7 @@ RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false RUN git config --global http.sslverify false
WORKDIR /openair-amf/ WORKDIR /openair-amf/
COPY ./ /openair-amf COPY . /openair-amf
# Installing all the needed libraries/packages to build and run AMF # Installing all the needed libraries/packages to build and run AMF
WORKDIR /openair-amf/build/scripts WORKDIR /openair-amf/build/scripts
...@@ -77,6 +77,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DE ...@@ -77,6 +77,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && DE
# Copying executable and generated libraries # Copying executable and generated libraries
WORKDIR /openair-amf/bin WORKDIR /openair-amf/bin
COPY --from=oai-amf-builder /openair-amf/build/amf/build/amf oai_amf COPY --from=oai-amf-builder /openair-amf/build/amf/build/amf oai_amf
COPY --from=oai-amf-builder /openair-amf/scripts/entrypoint.sh entrypoint.sh
WORKDIR /usr/lib/x86_64-linux-gnu WORKDIR /usr/lib/x86_64-linux-gnu
COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 . COPY --from=oai-amf-builder /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20 .
...@@ -109,7 +110,12 @@ RUN ldconfig ...@@ -109,7 +110,12 @@ RUN ldconfig
# Copying template configuration files # Copying template configuration files
WORKDIR /openair-amf/etc WORKDIR /openair-amf/etc
COPY --from=oai-amf-builder /openair-amf/etc/amf.conf . COPY --from=oai-amf-builder /openair-amf/etc/amf.conf .
COPY --from=oai-amf-builder /openair-amf/etc/modules.conf .
WORKDIR /openair-amf WORKDIR /openair-amf
# expose ports
EXPOSE 80/tcp 9090/tcp 38412/sctp
ENTRYPOINT ["/bin/bash","/openair-amf/bin/entrypoint.sh"]
CMD ["/openair-amf/bin/oai_amf", "-c", "/openair-amf/etc/amf.conf", "-o"]
\ No newline at end of file
...@@ -83,16 +83,16 @@ AMF = ...@@ -83,16 +83,16 @@ AMF =
NRF : NRF :
{ {
IPV4_ADDRESS = "192.168.66.9"; # "@NRF_IPV4_ADDRESS@"; # YOUR NRF CONFIG HERE IPV4_ADDRESS = "@NRF_IPV4_ADDRESS@"; # YOUR NRF CONFIG HERE
PORT = 80; # @NRF_PORT@; # YOUR NRF CONFIG HERE (default: 80) PORT = @NRF_PORT@; # YOUR NRF CONFIG HERE (default: 80)
API_VERSION = "v1"; # "@NRF_API_VERSION@"; # YOUR NRF API VERSION FOR SBI CONFIG HERE API_VERSION = "@NRF_API_VERSION@"; # YOUR NRF API VERSION FOR SBI CONFIG HERE
}; };
AUSF : AUSF :
{ {
IPV4_ADDRESS = "192.168.66.10"; # "@AUSF_IPV4_ADDRESS@"; # YOUR AUSF CONFIG HERE IPV4_ADDRESS = "@AUSF_IPV4_ADDRESS@"; # YOUR AUSF CONFIG HERE
PORT = 80; # @AUSF_PORT@; # YOUR AUSF CONFIG HERE (default: 80) PORT = @AUSF_PORT@; # YOUR AUSF CONFIG HERE (default: 80)
API_VERSION = "v1"; # "@AUSF_API_VERSION@"; # YOUR AUSF API VERSION FOR SBI CONFIG HERE API_VERSION = "@AUSF_API_VERSION@"; # YOUR AUSF API VERSION FOR SBI CONFIG HERE
}; };
}; };
......
File mode changed from 100755 to 100644
...@@ -2,19 +2,19 @@ ...@@ -2,19 +2,19 @@
set -euo pipefail set -euo pipefail
CONFIG_DIR="/oai-cn5g-amf/etc" CONFIG_DIR="/openair-amf/etc"
PUSH_PROTOCOL_OPTION=${PUSH_PROTOCOL_OPTION:-no}
for c in ${CONFIG_DIR}/*.conf; do for c in ${CONFIG_DIR}/*.conf; do
# grep variable names (format: ${VAR}) from template to be rendered # grep variable names (format: ${VAR}) from template to be rendered
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs) VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
echo "Now setting these variables '${VARS}'"
# create sed expressions for substituting each occurrence of ${VAR} # create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR" # with the value of the environment variable "VAR"
EXPRESSIONS="" EXPRESSIONS=""
for v in ${VARS}; do for v in ${VARS}; do
NEW_VAR=`echo $v | sed -e "s#@##g"` NEW_VAR=`echo $v | sed -e "s#@##g"`
if [[ "${!NEW_VAR}x" == "x" ]]; then if [[ -z ${!NEW_VAR+x} ]]; then
echo "Error: Environment variable '${NEW_VAR}' is not set." \ echo "Error: Environment variable '${NEW_VAR}' is not set." \
"Config file '$(basename $c)' requires all of $VARS." "Config file '$(basename $c)' requires all of $VARS."
exit 1 exit 1
...@@ -26,5 +26,5 @@ for c in ${CONFIG_DIR}/*.conf; do ...@@ -26,5 +26,5 @@ for c in ${CONFIG_DIR}/*.conf; do
# render template and inline replace config file # render template and inline replace config file
sed -i "${EXPRESSIONS}" ${c} sed -i "${EXPRESSIONS}" ${c}
done done
echo "Done setting the configuration"
exec "$@" exec "$@"
\ No newline at end of file
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