Skip to content

Commit

Permalink
Upgrade alpine version (#77)
Browse files Browse the repository at this point in the history
* Upgrade alpine version.

Signed-off-by: Thomas Montague <[email protected]>

* Add support for other container engines.

Signed-off-by: Thomas Montague <[email protected]>

* fix variable references in makefile.

* bump redis-exporter version.

---------

Signed-off-by: Thomas Montague <[email protected]>
Co-authored-by: yangw <[email protected]>
  • Loading branch information
montaguethomas and drivebyer authored Sep 18, 2024
1 parent fca3aa5 commit c0291bd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.15 as builder
FROM alpine:3.19 as builder

LABEL maintainer="Opstree Solutions"

Expand Down Expand Up @@ -31,7 +31,7 @@ RUN VERSION=$(echo ${REDIS_VERSION} | sed -e "s/^v//g"); \
make -C redis-${VERSION} all; \
make -C redis-${VERSION} install

FROM alpine:3.15
FROM alpine:3.19

LABEL maintainer="Opstree Solutions"

Expand All @@ -46,6 +46,8 @@ LABEL version=1.0 \
COPY --from=builder /usr/local/bin/redis-server /usr/local/bin/redis-server
COPY --from=builder /usr/local/bin/redis-cli /usr/local/bin/redis-cli

RUN apk update && apk upgrade

RUN addgroup -S -g 1000 redis && adduser -S -G redis -u 1000 redis && \
apk add --no-cache bash

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.exporter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.15 as builder
FROM alpine:3.19 as builder

ARG TARGETARCH

Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.sentinel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.15 as builder
FROM alpine:3.19 as builder

ARG TARGETARCH

Expand Down Expand Up @@ -30,7 +30,7 @@ RUN VERSION=$(echo ${REDIS_SENTINEL_VERSION} | sed -e "s/^v//g"); \
make -C redis-${VERSION} all; \
make -C redis-${VERSION} install

FROM alpine:3.15
FROM alpine:3.19

ARG TARGETARCH

Expand All @@ -44,6 +44,8 @@ LABEL version=1.0 \
COPY --from=builder /usr/local/bin/redis-cli /usr/local/bin/redis-cli
COPY --from=builder /usr/local/bin/redis-sentinel /usr/local/bin/redis-sentinel

RUN apk update && apk upgrade

RUN addgroup -S -g 1000 redis && adduser -S -G redis -u 1000 redis && \
apk add --no-cache bash

Expand Down
21 changes: 11 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
CONTAINER_ENGINE ?= docker
REDIS_VERSION ?= v7.0.13
SENTINEL_VERSION ?= v7.0.13
EXPORTER_VERSION ?= v1.48.0
REDIS_SENTINEL_VERSION ?= v7.0.13
REDIS_EXPORTER_VERSION ?= v1.61.0

IMG ?= quay.io/opstree/redis:$(REDIS_VERSION)
EXPORTER_IMG ?= quay.io/opstree/redis-exporter:$(EXPORTER_VERSION)
SENTINEL_IMG ?= quay.io/opstree/redis-sentinel:$(SENTINEL_VERSION)
EXPORTER_IMG ?= quay.io/opstree/redis-exporter:$(REDIS_EXPORTER_VERSION)
SENTINEL_IMG ?= quay.io/opstree/redis-sentinel:$(REDIS_SENTINEL_VERSION)

build-redis:
docker build -t ${IMG} -f Dockerfile .
${CONTAINER_ENGINE} build -t ${IMG} -f Dockerfile --build-arg REDIS_VERSION=${REDIS_VERSION} .

push-redis:
docker push ${IMG}
${CONTAINER_ENGINE} push ${IMG}

build-redis-exporter:
docker build -t ${EXPORTER_IMG} -f Dockerfile.exporter .
${CONTAINER_ENGINE} build -t ${EXPORTER_IMG} -f Dockerfile.exporter --build-arg REDIS_EXPORTER_VERSION=${REDIS_EXPORTER_VERSION} .

push-redis-exporter:
docker push ${EXPORTER_IMG}
${CONTAINER_ENGINE} push ${EXPORTER_IMG}

build-sentinel :
docker build -t ${SENTINEL_IMG} -f Dockerfile.sentinel .
${CONTAINER_ENGINE} build -t ${SENTINEL_IMG} -f Dockerfile.sentinel --build-arg REDIS_SENTINEL_VERSION=${REDIS_SENTINEL_VERSION} .

push-sentinel :
docker push ${SENTINEL_IMG}
${CONTAINER_ENGINE} push ${SENTINEL_IMG}

setup-standalone-server-compose:
docker-compose -f docker-compose-standalone.yaml up -d
Expand Down

0 comments on commit c0291bd

Please sign in to comment.