Take Redis 5.0 in use 80/880/1
authorMarco Tallskog <marco.tallskog@nokia.com>
Tue, 3 Sep 2019 12:11:26 +0000 (15:11 +0300)
committerMarco Tallskog <marco.tallskog@nokia.com>
Tue, 3 Sep 2019 12:14:38 +0000 (15:14 +0300)
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 <marco.tallskog@nokia.com>
container-tag.yaml
docker/Dockerfile.redis

index 45cc35a..5775dfa 100644 (file)
@@ -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'
index a8b0c32..00bf03f 100644 (file)
 #   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