X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=sidecars%2Flistener%2FDockerfile;h=9d2da6cc58601528d2c7163ef65e52fba311f00c;hb=refs%2Fchanges%2F54%2F5254%2F1;hp=861401f983cee169911315edd94150dd12782111;hpb=b6c66513ba500ecfa8b3a6d07c266b4588911fb6;p=ric-app%2Fmc.git diff --git a/sidecars/listener/Dockerfile b/sidecars/listener/Dockerfile index 861401f..9d2da6c 100644 --- a/sidecars/listener/Dockerfile +++ b/sidecars/listener/Dockerfile @@ -17,7 +17,7 @@ # Mnemonic: Dockerfile -# Abstract: Build file which creaes a runtime image for the listener. +# Abstract: Build file which creaes a runtime image for the listener. # Building should be as simple as: # # docker build -f sidecars/listener/Dockerfile -t mc_listener:xx.xx . @@ -41,37 +41,50 @@ # Author: E. Scott Daniels -FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:4-u18.04-nng as buildenv +FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:9-u18.04 as buildenv + RUN mkdir /playpen RUN apt-get update && apt-get install -y cmake gcc make git g++ wget WORKDIR /playpen # Install RMr (runtime and dev) from debian package cached on packagecloud.io -ARG RMR_VER=3.5.1 +ARG RMR_VER=4.4.6 +ARG RMR_PC_REPO=staging +#ARG RMR_PC_REPO=release -RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb -RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb +RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/${RMR_PC_REPO}/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb +RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/${RMR_PC_REPO}/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb RUN dpkg -i rmr_${RMR_VER}_amd64.deb RUN dpkg -i rmr-dev_${RMR_VER}_amd64.deb -RUN mkdir /playpen/bin /playpen/src -ARG SRC=. -COPY ${SRC}/*.ksh ${SRC}/Makefile ${SRC}/*.h ${SRC}/*.c /playpen/src/ -COPY ${SRC}/verify_replay.sh ${SRC}/verify.sh /playpen/src/ +RUN mkdir -p /playpen/bin /playpen/listener/src /playpen/listener/test +ARG SRC=src +COPY ${SRC}/*.ksh ${SRC}/Makefile ${SRC}/*.h ${SRC}/*.c /playpen/listener/src/ +COPY ${SRC}/verify_replay.sh ${SRC}/verify.sh /playpen/listener/src/ + +ARG TEST=test +COPY ${TEST}/*.ksh ${TEST}/Makefile ${TEST}/*.h ${TEST}/*.c /playpen/listener/test/ # Build all binaries; verify scripts expect them to be in bin, so we must copy too # ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ENV C_INCLUDE_PATH=/usr/local/include -RUN cd /playpen/src/; make -B all; ls -al mc_listener; cp mc_listener sender pipe_reader rdc_replay rdc_extract /playpen/bin/ +RUN cd /playpen/listener/src \ + && make -B all \ + && ls -al mc_listener \ + && cp mc_listener sender pipe_reader rdc_replay rdc_extract /playpen/bin/ # Run unit tests. If they don't pass the build fails here. Tests can be run from src, but expect binaries in bin # so that they can be run in the final image as well. # -ENV PATH /playpen/bin:/playpen/src:$PATH -RUN cd /playpen/src/; ./run_unit_test.ksh -RUN /playpen/src/verify.sh; /playpen/src/verify_replay.sh +ENV PATH /playpen/bin:/playpen/listener/src:$PATH +RUN cd /playpen/listener/test \ + && ./run_unit_test.ksh + +RUN cd /playpen/listener/src \ + && /playpen/listener/src/verify.sh \ + && /playpen/listener/src/verify_replay.sh # ----- final, smaller image ---------------------------------- @@ -79,15 +92,26 @@ FROM ubuntu:18.04 # bash doesn't cut it for run_replay so grab a real shell and clean up as much as we can RUN apt-get update; apt-get install -y ksh -RUN rm -fr /var/lib/apt/lists +RUN rm -fr /var/lib/apt/lists + +# must have rmr runtime to get health check etc +COPY --from=buildenv /playpen/rmr_*.deb /tmp/ +RUN dpkg -i /tmp/rmr_*_amd64.deb -# obtusely this uses the previous value -ARG SRC +ARG SRC=src +ARG PPSRC=/playpen/listener/src RUN mkdir -p /playpen/bin + +# pull from the huge builder image COPY --from=buildenv /usr/local/lib/* /usr/local/lib/ -COPY --from=buildenv /playpen/src/mc_listener /playpen/src/sender /playpen/src/pipe_reader /playpen/src/rdc_replay /playpen/src/rdc_extract /playpen/bin/ -COPY ${SRC}/verify_replay.sh ${SRC}/verify.sh ${SRC}/run_replay.sh ${SRC}/help /playpen/bin/ +COPY --from=buildenv ${PPSRC}/mc_listener ${PPSRC}/sender ${PPSRC}/pipe_reader ${PPSRC}/rdc_replay ${PPSRC}/rdc_extract /playpen/bin/ + +# pull from the source +COPY ${SRC}/verify_replay.sh ${SRC}/verify.sh ${SRC}/run_replay.sh /playpen/bin/ +COPY ${SRC}/help.sh /playpen/bin/help + +RUN chmod 755 /playpen/bin/* ENV PATH=/playpen/bin:$PATH ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib