--- /dev/null
+#
+#==================================================================================
+# Copyright (c) 2019 AT&T Intellectual Property.
+# Copyright (c) 2019 Nokia
+#
+# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+#==================================================================================
+#
+#
+# Abstract: Builds a container to compile Subscription Manager's code
+# Date: 28 May 2019
+#
+FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:1-u18.04-nng1.1.1 as submgrbuild
+
+COPY . /opt/submgr
+
+# Install RMr shared library
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/rmr_1.0.36_amd64.deb/download.deb && dpkg -i rmr_1.0.36_amd64.deb
+# Install RMr development header files
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/rmr-dev_1.0.36_amd64.deb/download.deb && dpkg -i rmr-dev_1.0.36_amd64.deb
+
+# "PULLING LOG and COMPILING LOG"
+RUN git clone "https://gerrit.o-ran-sc.org/r/com/log" /opt/log && cd /opt/log && \
+ ./autogen.sh && ./configure && make install && ldconfig
+
+# "COMPILING Subscription manager"
+RUN mkdir -p /opt/bin && cd /opt/submgr && \
+ /usr/local/go/bin/go get && \
+ /usr/local/go/bin/go build -o /opt/bin/submgr ./cmd/submgr.go && \
+ mkdir -p /opt/build/container/usr/local
+
+FROM ubuntu:18.04
+
+COPY --from=submgrbuild /opt/bin/submgr /opt/submgr/config/submgr.yaml /
+COPY run_submgr.sh /
+COPY --from=submgrbuild /usr/local/include /usr/local/include
+COPY --from=submgrbuild /usr/local/lib /usr/local/lib
+RUN ldconfig
+
+CMD /run_submgr.sh
\ No newline at end of file
## Installation guide
### Compiling code
-Enter the project root and execute `./build.sh` script.
-The build script has two main phases. First is the code compilation, where it creates a temporary container for downloading all dependencies then compiles the code. In the second phase it builds the production ready container and taggs it to `submgr:builder`
+Enter the project root and execute ` docker build -t submgr:tag .`.
+The Dockerfile has two main phases. First is the code compilation, where it creates an intermediate container for downloading all dependencies then compiles the code. In the second phase it builds the production ready container.
-**NOTE:** The script puts a copy of the binary into the `./bin` folder for further use cases
+**NOTE:** If you are behind proxy, see this guide: https://docs.docker.com/network/proxy/#configure-the-docker-client
### Installing Subscription Manager
#### Preparing environment
+### v0.1.1
+* Dockerfile updates
### v0.1.0i
* Receives and Forwards RMR Subscription Requests
* Introduces RCO (Stub xApp) and E2T (Stub Platform Component) for testing purposes
+++ /dev/null
-#!/bin/sh -e
-#
-#==================================================================================
-# Copyright (c) 2019 AT&T Intellectual Property.
-# Copyright (c) 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#==================================================================================
-#
-#
-# Mnemonic: build.sh
-# Abstract: Compiles the Subscription Manager's source and builds the docker container
-# Date: 28 May 2019
-#
-
-echo 'Creating compiler container'
-docker build --no-cache --tag=submgr_compiler:0.1 $PWD/build/binary/
-
-echo 'Running submgr compiler'
-docker run --rm -v ${PWD}:/opt submgr_compiler:0.1
-
-echo 'Cleaning up compiler container'
-docker rmi -f submgr_compiler:0.1
-
-echo 'submgr binary successfully built!'
-
-echo 'Creating submgr container'
-docker build --no-cache --tag=submgr:builder ${PWD}/build/container/
-
+++ /dev/null
-#
-#==================================================================================
-# Copyright (c) 2019 AT&T Intellectual Property.
-# Copyright (c) 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#==================================================================================
-#
-#
-# Abstract: Builds a container to compile Subscription Manager's code
-# Date: 28 May 2019
-#
-FROM golang:1.12
-
-COPY compile.sh /
-RUN apt-get update \
- && apt-get install -y git vim build-essential cmake ksh autotools-dev dh-autoreconf gawk autoconf-archive
-
-ENTRYPOINT /compile.sh
+++ /dev/null
-#!/bin/sh -e
-#
-#==================================================================================
-# Copyright (c) 2019 AT&T Intellectual Property.
-# Copyright (c) 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#==================================================================================
-#
-#
-# Mnemonic: compile.sh
-# Abstract: Compiles the source of Subscription Manager service and the two platform component stubs
-# Date: 28 May 2019
-#
-echo "PULLING RMR"
-cd /opt
-git clone "https://gerrit.o-ran-sc.org/r/ric-plt/lib/rmr"
-echo "START COMPILING RMR"
-cd /opt/rmr
-git checkout v1.0.31
-mkdir -p build
-cd build
-cmake ..
-make install
-
-echo "PULLING LOG"
-cd /opt
-git clone "https://gerrit.o-ran-sc.org/r/com/log"
-echo "START COMPILING LOG"
-cd /opt/log
-./autogen.sh
-./configure
-make install
-
-ldconfig
-
-echo "DOWNLOAD GO DEPENDENCIES"
-cd /opt/
-mkdir -p /opt/bin
-go get
-
-echo "START COMPILING COMPONENTS"
-go build -o /opt/bin/submgr ./cmd/submgr.go
-go build -o /opt/test/rco/rco ./test/rco/rco.go
-go build -o /opt/test/e2t/e2t ./test/e2t/e2t.go
-
-echo "SAVE RESULT"
-mkdir -p /opt/build/container/usr/local /opt/test/e2t/container/usr/local /opt/test/rco/container/usr/local
-cp -Rf /usr/local/lib /usr/local/include /opt/build/container/usr/local/
-cp -Rf /usr/local/lib /usr/local/include /opt/test/e2t/container/usr/local/
-cp -Rf /usr/local/lib /usr/local/include /opt/test/rco/container/usr/local/
-cp bin/submgr config/submgr.yaml /opt/build/container/
-
-echo "CLEANUP"
-rm -Rf /opt/rmr /opt/log /opt/go.sum
-
-echo "DONE"
+++ /dev/null
-#
-#==================================================================================
-# Copyright (c) 2019 AT&T Intellectual Property.
-# Copyright (c) 2019 Nokia
-#
-# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-#==================================================================================
-#
-#
-# Abstract: Builds the Subscription Manager's production ready container image
-# Date: 28 May 2019
-#
-
-FROM ubuntu
-
-COPY submgr /
-COPY submgr.yaml /
-COPY run_submgr.sh /
-COPY usr/ /usr/
-RUN ldconfig
\ No newline at end of file
--- /dev/null
+# The Jenkins job requires a tag to build the Docker image.
+# By default this file is in the docker build directory,
+# but the location can configured in the JJB template.
+---
+tag: 0.1.1
spec:
containers:
- name: submgr
- image: cmaster:5000/submgr:0.1.0i
+ image: cmaster:5000/submgr:0.1.1
command: ["/run_submgr.sh"]
env:
- name: DBAAS_SERVICE_HOST
# Date: 28 May 2019
#
-cp -Rf ${PWD}/e2t ${PWD}/e2t.yaml ${PWD}/container/
-
echo 'Creating E2T container'
-docker build --no-cache --tag=e2t:builder ${PWD}/container/
+docker build --no-cache --tag=e2t:builder -f container/Dockerfile ../..
# Date: 28 May 2019
#
-FROM ubuntu
+FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:1-u18.04-nng1.1.1 as submgrbuild
+
+# Install RMr shared library
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/rmr_1.0.36_amd64.deb/download.deb && dpkg -i rmr_1.0.36_amd64.deb
+# Install RMr development header files
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/rmr-dev_1.0.36_amd64.deb/download.deb && dpkg -i rmr-dev_1.0.36_amd64.deb
+
+# "PULLING LOG and COMPILING LOG"
+RUN git clone "https://gerrit.o-ran-sc.org/r/com/log" /opt/log && cd /opt/log && \
+ ./autogen.sh && ./configure && make install && ldconfig
+
+COPY . /opt/submgr
+RUN mkdir -p /opt/bin && cd /opt/submgr && \
+ /usr/local/go/bin/go get && \
+ /usr/local/go/bin/go build -o /opt/test/e2t/e2t ./test/e2t/e2t.go && \
+ mkdir -p /opt/test/e2t/container/usr/local
+
+FROM ubuntu:18.04
+
+COPY --from=submgrbuild /opt/test/e2t/e2t /
+COPY test/e2t/e2t.yaml test/e2t/container/run_e2t.sh /
+COPY --from=submgrbuild /usr/local/include /usr/local/include
+COPY --from=submgrbuild /usr/local/lib /usr/local/lib
-COPY e2t /
-COPY e2t.yaml /
-COPY run_e2t.sh /
-COPY usr/ /usr/
RUN ldconfig
\ No newline at end of file
+++ /dev/null
-# Copyright (c) 2019 AT&T Intellectual Property.
-# Copyright (c) 2019 Nokia.
-#
-# Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
-#
-# 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.
-
-"local":
- "host": ":8080"
-"logger":
- "level": 4
-"rmr":
- "protPort": "tcp:4560"
- "maxSize": 2072
- "numWorkers": 1
# Date: 28 May 2019
#
-cp -Rf ${PWD}/rco ${PWD}/rco.yaml ${PWD}/container/
-
echo 'Creating RCO container'
-docker build --no-cache --tag=rco:builder ${PWD}/container/
+docker build --no-cache --tag=rco:builder -f container/Dockerfile ../..
# Date: 28 May 2019
#
-FROM ubuntu
+FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:1-u18.04-nng1.1.1 as submgrbuild
+
+# Install RMr shared library
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/rmr_1.0.36_amd64.deb/download.deb && dpkg -i rmr_1.0.36_amd64.deb
+# Install RMr development header files
+RUN wget --content-disposition https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/rmr-dev_1.0.36_amd64.deb/download.deb && dpkg -i rmr-dev_1.0.36_amd64.deb
+
+# "PULLING LOG and COMPILING LOG"
+RUN git clone "https://gerrit.o-ran-sc.org/r/com/log" /opt/log && cd /opt/log && \
+ ./autogen.sh && ./configure && make install && ldconfig
+
+COPY . /opt/submgr
+RUN mkdir -p /opt/bin && cd /opt/submgr && \
+ /usr/local/go/bin/go get && \
+ /usr/local/go/bin/go build -o /opt/test/rco/rco ./test/rco/rco.go && \
+ mkdir -p /opt/test/rco/container/usr/local
+
+FROM ubuntu:18.04
+
+COPY --from=submgrbuild /opt/test/rco/rco /
+COPY test/rco/rco.yaml test/rco/container/run_rco.sh /
+COPY --from=submgrbuild /usr/local/include /usr/local/include
+COPY --from=submgrbuild /usr/local/lib /usr/local/lib
-COPY rco /
-COPY rco.yaml /
-COPY run_rco.sh /
-COPY usr/ /usr/
RUN ldconfig
\ No newline at end of file