Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-NRF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-NRF
Commits
53030a32
Commit
53030a32
authored
Feb 05, 2021
by
sagar arora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dockerfile update
parent
328dbea9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
26 deletions
+40
-26
docker/Dockerfile.ubuntu18.04
docker/Dockerfile.ubuntu18.04
+9
-2
docker/docker-compose.yaml
docker/docker-compose.yaml
+4
-2
docker/entrypoint.sh
docker/entrypoint.sh
+27
-22
No files found.
docker/Dockerfile.ubuntu18.04
View file @
53030a32
...
...
@@ -2,6 +2,7 @@
#
# Dockerfile for the Open-Air-Interface NRF service
# Valid for Ubuntu-18.04 (bionic)
# The port exposed by container are 8080/tcp , 9090/tcp change it according to your setup
#
#---------------------------------------------------------------------
...
...
@@ -26,7 +27,7 @@ RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
# Copying source code
COPY
.
/openair-nrf
COPY
/oai-cn5g-nrf
/openair-nrf
WORKDIR /openair-nrf
# Installing and Building NRF
...
...
@@ -70,4 +71,10 @@ COPY --from=oai-nrf-builder /openair-nrf/docker/entrypoint.sh /openair-nrf/
WORKDIR /openair-nrf
#ENTRYPOINT ["/openair-nrf/entrypoint.sh"]
EXPOSE 8080/tcp 9090/tcp
RUN chmod +x entrypoint.sh
CMD ["/openair-nrf/bin/oai_nrf", "-c", "/openair-nrf/etc/nrf.conf", "-o"]
ENTRYPOINT ["/bin/bash","entrypoint.sh"]
\ No newline at end of file
docker/docker-compose.yaml
View file @
53030a32
...
...
@@ -2,7 +2,7 @@ version: '3'
services
:
oai_nrf
:
container_name
:
"
oai_nrf"
image
:
oainrf:1.0
image
:
oai
-
nrf:1.0
ports
:
-
8080:8080
-
9092:9092
...
...
@@ -11,6 +11,8 @@ services:
-
NRF_INTERFACE_PORT_FOR_SBI=8080
-
NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
-
NRF_API_VERSION=v1
-
INSTANCE=0
-
PID_DIRECTORY=/var/run
networks
:
default
:
driver
:
bridge
...
...
docker/entrypoint.sh
View file @
53030a32
...
...
@@ -6,27 +6,32 @@
#---------------------------------------------------------------------
#!/bin/bash
INSTANCE
=
1
PREFIX
=
'/usr/local/etc/oai'
mkdir
-m
0777
-p
$PREFIX
cp
/openair-nrf/etc/nrf.conf
$PREFIX
declare
-A
NRF_CONF
NRF_CONF[@INSTANCE@]
=
$INSTANCE
NRF_CONF[@PREFIX@]
=
$PREFIX
NRF_CONF[@PID_DIRECTORY@]
=
'/var/run'
NRF_CONF[@NRF_INTERFACE_NAME_FOR_SBI@]
=
$NRF_INTERFACE_NAME_FOR_SBI
NRF_CONF[@NRF_INTERFACE_PORT_FOR_SBI@]
=
$NRF_INTERFACE_PORT_FOR_SBI
NRF_CONF[@NRF_INTERFACE_HTTP2_PORT_FOR_SBI@]
=
$NRF_INTERFACE_HTTP2_PORT_FOR_SBI
NRF_CONF[@NRF_API_VERSION@]
=
$NRF_API_VERSION
for
K
in
"
${
!NRF_CONF[@]
}
"
;
do
egrep
-lRZ
"
$K
"
$PREFIX
| xargs
-0
-l
sed
-i
-e
"s|
$K
|
${
NRF_CONF
[
$K
]
}
|g"
ret
=
$?
;
[[
ret
-ne
0
]]
&&
echo
"Tried to replace
$K
with
${
NRF_CONF
[
$K
]
}
"
set
-euo
pipefail
CONFIG_DIR
=
"/openair-nrf/etc"
PUSH_PROTOCOL_OPTION
=
${
PUSH_PROTOCOL_OPTION
:-
no
}
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
cd
/openair-nrf/bin/
&&
./oai_nrf
-c
/usr/local/etc/oai/nrf.conf
-o
\ No newline at end of file
exec
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment