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
Hide 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 @@
...
@@ -2,6 +2,7 @@
#
#
# Dockerfile for the Open-Air-Interface NRF service
# Dockerfile for the Open-Air-Interface NRF service
# Valid for Ubuntu-18.04 (bionic)
# 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
...
@@ -26,7 +27,7 @@ RUN git config --global https.postBuffer 123289600
RUN git config --global http.sslverify false
RUN git config --global http.sslverify false
# Copying source code
# Copying source code
COPY
.
/openair-nrf
COPY
/oai-cn5g-nrf
/openair-nrf
WORKDIR /openair-nrf
WORKDIR /openair-nrf
# Installing and Building NRF
# Installing and Building NRF
...
@@ -70,4 +71,10 @@ COPY --from=oai-nrf-builder /openair-nrf/docker/entrypoint.sh /openair-nrf/
...
@@ -70,4 +71,10 @@ COPY --from=oai-nrf-builder /openair-nrf/docker/entrypoint.sh /openair-nrf/
WORKDIR /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'
...
@@ -2,7 +2,7 @@ version: '3'
services
:
services
:
oai_nrf
:
oai_nrf
:
container_name
:
"
oai_nrf"
container_name
:
"
oai_nrf"
image
:
oainrf:1.0
image
:
oai
-
nrf:1.0
ports
:
ports
:
-
8080:8080
-
8080:8080
-
9092:9092
-
9092:9092
...
@@ -11,9 +11,11 @@ services:
...
@@ -11,9 +11,11 @@ services:
-
NRF_INTERFACE_PORT_FOR_SBI=8080
-
NRF_INTERFACE_PORT_FOR_SBI=8080
-
NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
-
NRF_INTERFACE_HTTP2_PORT_FOR_SBI=9090
-
NRF_API_VERSION=v1
-
NRF_API_VERSION=v1
-
INSTANCE=0
-
PID_DIRECTORY=/var/run
networks
:
networks
:
default
:
default
:
driver
:
bridge
driver
:
bridge
ipam
:
ipam
:
config
:
config
:
-
subnet
:
172.18.59.0/24
-
subnet
:
172.18.59.0/24
\ No newline at end of file
docker/entrypoint.sh
View file @
53030a32
...
@@ -6,27 +6,32 @@
...
@@ -6,27 +6,32 @@
#---------------------------------------------------------------------
#---------------------------------------------------------------------
#!/bin/bash
#!/bin/bash
INSTANCE
=
1
set
-euo
pipefail
PREFIX
=
'/usr/local/etc/oai'
mkdir
-m
0777
-p
$PREFIX
CONFIG_DIR
=
"/openair-nrf/etc"
cp
/openair-nrf/etc/nrf.conf
$PREFIX
PUSH_PROTOCOL_OPTION
=
${
PUSH_PROTOCOL_OPTION
:-
no
}
declare
-A
NRF_CONF
for
c
in
${
CONFIG_DIR
}
/
*
.conf
;
do
# grep variable names (format: ${VAR}) from template to be rendered
NRF_CONF[@INSTANCE@]
=
$INSTANCE
VARS
=
$(
grep
-oP
'@[a-zA-Z0-9_]+@'
${
c
}
|
sort
|
uniq
| xargs
)
NRF_CONF[@PREFIX@]
=
$PREFIX
NRF_CONF[@PID_DIRECTORY@]
=
'/var/run'
# create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR"
NRF_CONF[@NRF_INTERFACE_NAME_FOR_SBI@]
=
$NRF_INTERFACE_NAME_FOR_SBI
EXPRESSIONS
=
""
for
v
in
${
VARS
}
;
do
NRF_CONF[@NRF_INTERFACE_PORT_FOR_SBI@]
=
$NRF_INTERFACE_PORT_FOR_SBI
NEW_VAR
=
`
echo
$v
|
sed
-e
"s#@##g"
`
NRF_CONF[@NRF_INTERFACE_HTTP2_PORT_FOR_SBI@]
=
$NRF_INTERFACE_HTTP2_PORT_FOR_SBI
if
[[
"
${
!NEW_VAR
}
x"
==
"x"
]]
;
then
NRF_CONF[@NRF_API_VERSION@]
=
$NRF_API_VERSION
echo
"Error: Environment variable '
${
NEW_VAR
}
' is not set."
\
"Config file '
$(
basename
$c
)
' requires all of
$VARS
."
exit
1
for
K
in
"
${
!NRF_CONF[@]
}
"
;
do
fi
egrep
-lRZ
"
$K
"
$PREFIX
| xargs
-0
-l
sed
-i
-e
"s|
$K
|
${
NRF_CONF
[
$K
]
}
|g"
EXPRESSIONS
=
"
${
EXPRESSIONS
}
;s|
${
v
}
|
${
!NEW_VAR
}
|g"
ret
=
$?
;
[[
ret
-ne
0
]]
&&
echo
"Tried to replace
$K
with
${
NRF_CONF
[
$K
]
}
"
done
EXPRESSIONS
=
"
${
EXPRESSIONS
#
';'
}
"
# render template and inline replace config file
sed
-i
"
${
EXPRESSIONS
}
"
${
c
}
done
done
cd
/openair-nrf/bin/
&&
./oai_nrf
-c
/usr/local/etc/oai/nrf.conf
-o
exec
"
$@
"
\ No newline at end of file
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