Add initial codes
[it/test.git] / ons_2019_demo / load_consumer / Dockerfile
diff --git a/ons_2019_demo/load_consumer/Dockerfile b/ons_2019_demo/load_consumer/Dockerfile
new file mode 100644 (file)
index 0000000..2ca8440
--- /dev/null
@@ -0,0 +1,51 @@
+#\r
+# Copyright 2019 AT&T Intellectual Property\r
+# Copyright 2019 Nokia\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+#      http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+#\r
+\r
+# sudo docker build -t load_consumer .\r
+# sudo docker run --rm -it load_consumer\r
+\r
+FROM ubuntu:16.04\r
+\r
+# Install necessary packages\r
+RUN apt-get update\r
+RUN apt-get update && apt-get install -y gcc git make bash vim cmake g++ ksh\r
+RUN apt-get install -y iputils-ping\r
+\r
+# Install rmr in /usr/local\r
+WORKDIR /home\r
+RUN git clone https://gerrit.oran-osc.org/r/ric-plt/lib/rmr\r
+RUN date; ls -al /usr/local/lib\r
+RUN cd rmr; git checkout 6735f136906ce2; mkdir .build; cd .build; cmake ..; make install\r
+\r
+# COPY code\r
+RUN     mkdir /home/load_consumer\r
+COPY    ./ /home/load_consumer\r
+WORKDIR /home/load_consumer\r
+\r
+# Configure the receiver\r
+RUN mkdir /usr/local/route\r
+ENV C_INCLUDE_PATH=/usr/local/include\r
+ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib\r
+\r
+# local.rt should be in the /usr/local/route directory mounted from the outside world.\r
+# example for command line:  -v /demo/test/route:/usr/local/route\r
+ENV RMR_SEED_RT=/usr/local/route/local.rt\r
+# export RMR_SEED_RT=$HOME/global_rmr_files/global_rmr_routes.rt\r
+\r
+RUN gcc dummy_rcvr.c -g -o dummy_rcvr -L /usr/local/lib -lrmr_nng -lnng -lpthread -lm\r
+\r
+CMD ./dummy_rcvr\r