build in two steps

This commit is contained in:
f 2022-03-07 11:43:14 -03:00
parent b0a9545e14
commit 3052602c43
2 changed files with 12 additions and 4 deletions

View file

@ -2,7 +2,7 @@ pipeline:
publish:
image: plugins/docker
registry: registry.nulo.in
repo: registry.nulo.in/sutty/CHANGEME
repo: registry.nulo.in/sutty/redis
tags:
- ${ALPINE_VERSION}
- latest

View file

@ -1,12 +1,10 @@
ARG ALPINE_VERSION=3.13.6
ARG BASE_IMAGE=sutty/monit
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
FROM ${BASE_IMAGE}:${ALPINE_VERSION} AS build
MAINTAINER "f <f@sutty.nl>"
RUN apk add --no-cache redis
COPY ./monit.conf /etc/monit.d/redis.conf
RUN sed -re "/^bind /d" -i /etc/redis.conf
RUN sed -re "/^protected-mode /d" -i /etc/redis.conf
RUN sed -re "/^logfile /d" -i /etc/redis.conf
@ -18,5 +16,15 @@ RUN echo "protected-mode no" >> /etc/redis.conf
RUN echo "maxmemory-policy allkeys-lfu" >> /etc/redis.conf
RUN echo "maxmemory 100mb" >> /etc/redis.conf
ARG ALPINE_VERSION=3.13.6
ARG BASE_IMAGE=sutty/monit
FROM ${BASE_IMAGE}:${ALPINE_VERSION}
MAINTAINER "f <f@sutty.nl>"
RUN apk add --no-cache redis
COPY --from=build /etc/redis.conf /etc/redis.conf
COPY ./monit.conf /etc/monit.d/redis.conf
EXPOSE 6379
VOLUME "/var/lib/redis"