X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=sidecars%2Flistener%2FDockerfile;h=861401f983cee169911315edd94150dd12782111;hb=c6e101be1e01d788f02c498cf88aa3b5b58e57d0;hp=c5f8c516003aa9ac970f7ff3324907c211b031b1;hpb=3cbdc585f92f4299f4e05108f9ed76766a72ff84;p=ric-app%2Fmc.git diff --git a/sidecars/listener/Dockerfile b/sidecars/listener/Dockerfile index c5f8c51..861401f 100644 --- a/sidecars/listener/Dockerfile +++ b/sidecars/listener/Dockerfile @@ -41,14 +41,14 @@ # Author: E. Scott Daniels -FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu16-c-go:2-u16.04-nng as buildenv +FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:4-u18.04-nng 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=1.10.2 +ARG RMR_VER=3.5.1 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 @@ -57,22 +57,37 @@ RUN dpkg -i rmr-dev_${RMR_VER}_amd64.deb RUN mkdir /playpen/bin /playpen/src ARG SRC=. -COPY ${SRC}/Makefile ${SRC}/*.h ${SRC}/*.c /playpen/src/ +COPY ${SRC}/*.ksh ${SRC}/Makefile ${SRC}/*.h ${SRC}/*.c /playpen/src/ +COPY ${SRC}/verify_replay.sh ${SRC}/verify.sh /playpen/src/ +# 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 mc_listener sender pipe_reader rdc_replay +RUN cd /playpen/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 + # ----- final, smaller image ---------------------------------- 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 + # obtusely this uses the previous value ARG SRC RUN mkdir -p /playpen/bin 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/bin/ -COPY ${SRC}/verify_replay.sh ${SRC}/verify.sh ${SRC}run_replay.sh ${SRC}/help /playpen/bin/ +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/ ENV PATH=/playpen/bin:$PATH ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib