From afd011bcc07261f153a2583cf6f27486a40c69ce Mon Sep 17 00:00:00 2001 From: f Date: Mon, 7 Mar 2022 14:24:20 -0300 Subject: [PATCH] configurable memory --- .woodpecker.yml | 5 ++++- Dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 40aeff4..dab35a9 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,9 +4,10 @@ pipeline: registry: registry.nulo.in repo: registry.nulo.in/sutty/redis tags: - - ${ALPINE_VERSION} + - ${ALPINE_VERSION}-${MAX_MEMORY} - latest build_args: + - MAX_MEMORY=${MAX_MEMORY} - ALPINE_VERSION=${ALPINE_VERSION} - BASE_IMAGE=registry.nulo.in/sutty/monit username: sutty @@ -16,6 +17,8 @@ pipeline: branch: antifascista event: push matrix: + MAX_MEMORY: + - "100mb" ALPINE_VERSION: - 3.13.7 - 3.14.3 diff --git a/Dockerfile b/Dockerfile index ccf0733..6148e92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ +ARG MAX_MEMORY=100mb ARG ALPINE_VERSION=3.13.6 ARG BASE_IMAGE=sutty/monit FROM ${BASE_IMAGE}:${ALPINE_VERSION} AS build MAINTAINER "f " +ARG MAX_MEMORY + RUN apk add --no-cache redis RUN sed -re "/^bind /d" -i /etc/redis.conf @@ -14,7 +17,7 @@ RUN echo "pidfile /run/redis/redis.pid" >> /etc/redis.conf RUN echo "daemonize yes" >> /etc/redis.conf RUN echo "protected-mode no" >> /etc/redis.conf RUN echo "maxmemory-policy allkeys-lfu" >> /etc/redis.conf -RUN echo "maxmemory 100mb" >> /etc/redis.conf +RUN echo "maxmemory ${MAX_MEMORY}" >> /etc/redis.conf ARG ALPINE_VERSION=3.13.6 ARG BASE_IMAGE=sutty/monit