From f8b6e48790a8fd7cd616d2a53a671b872c22a2fb Mon Sep 17 00:00:00 2001 From: Marco Tallskog Date: Tue, 3 Sep 2019 15:11:26 +0300 Subject: [PATCH] Take Redis 5.0 in use Modify the dockerfile to use two phase build process. In the first phase build the redismodules and install them in the second phase. The actual docker image is built using the publicly available redis docker file which is using alpine distribution as a base build. Change-Id: I292c58a61a114b951434bbd26f4798fc1b50d63d Signed-off-by: Marco Tallskog --- container-tag.yaml | 2 +- docker/Dockerfile.redis | 26 +++++--------------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/container-tag.yaml b/container-tag.yaml index 45cc35a..5775dfa 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -2,4 +2,4 @@ # This file is expected to be in the docker build directory; # can be moved with suitable JJB configuration. --- -tag: '0.1.0' +tag: '0.2.0' diff --git a/docker/Dockerfile.redis b/docker/Dockerfile.redis index a8b0c32..00bf03f 100644 --- a/docker/Dockerfile.redis +++ b/docker/Dockerfile.redis @@ -13,32 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ubuntu:latest +FROM nexus3.o-ran-sc.org:10004/bldr-alpine3:5-a3.9 as build-env -# Install redis -RUN apt update && \ - apt install -y redis-server && \ - apt clean -# Install Redis modules -RUN apt install -y build-essential && \ - apt install -y automake && \ - apt install -y libtool && \ - apt clean -COPY ./redismodule ./redismodule +COPY ./redismodule /redismodule WORKDIR /redismodule RUN ./autogen.sh && \ ./configure && \ make install -j -# Create suitable configuration file -RUN sed -i 's/^\(bind .*\)$/# \1/' /etc/redis/redis.conf && \ - sed -i 's/^\(daemonize .*\)$/# \1/' /etc/redis/redis.conf && \ - sed 's/^protected-mode yes/protected-mode no/' -i /etc/redis/redis.conf && \ - echo 'loadmodule /usr/local/libexec/redismodule/libredismodule.so' >> /etc/redis/redis.conf && \ - sed -i 's/^\(save .*\)$/# \1/' /etc/redis/redis.conf && \ - echo 'save ""' >> /etc/redis/redis.conf +FROM redis:5.0.5-alpine3.9 -EXPOSE 6379 - -CMD ["redis-server", "/etc/redis/redis.conf"] +COPY --from=build-env /usr/local/libexec/redismodule/libredismodule.so /usr/local/libexec/redismodule/libredismodule.so +WORKDIR /data -- 2.16.6