diff --git a/.github/workflows/push-image.yaml b/.github/workflows/push-image.yaml index 3a839bc..ce11cf8 100644 --- a/.github/workflows/push-image.yaml +++ b/.github/workflows/push-image.yaml @@ -5,8 +5,8 @@ on: branches: [master] env: - REDIS_VERSION: latest - REDIS_SENTINEL_VERSION: latest + REDIS_VERSION: v6.2.14 + REDIS_SENTINEL_VERSION: v6.2.14 REDIS_EXPORTER_VERSION: latest jobs: @@ -32,6 +32,8 @@ jobs: file: Dockerfile platforms: linux/amd64,linux/arm64 push: true + build-args: | + REDIS_VERSION=${{ env.REDIS_VERSION }} tags: quay.io/opstree/redis:${{ env.REDIS_VERSION }} build_redis_sentinel: @@ -56,6 +58,8 @@ jobs: file: Dockerfile.sentinel platforms: linux/amd64,linux/arm64 push: true + build-args: | + REDIS_SENTINEL_VERSION=${{ env.REDIS_SENTINEL_VERSION }} tags: quay.io/opstree/redis-sentinel:${{ env.REDIS_SENTINEL_VERSION }} build_redis_exporter: diff --git a/Dockerfile b/Dockerfile index 25b4162..5b7b146 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,14 @@ RUN apk add --no-cache su-exec tzdata make curl build-base linux-headers bash op WORKDIR /tmp -RUN curl -fL -Lo redis-${REDIS_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_VERSION}.tar.gz && \ +RUN if [ "${REDIS_VERSION}" = "stable" ]; then \ + curl -fL -Lo redis-${REDIS_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-stable.tar.gz; \ + else \ + if [ "${REDIS_VERSION:0:1}" = "v" ]; then \ + REDIS_VERSION=${REDIS_VERSION:1}; \ + fi; \ + curl -fL -Lo redis-${REDIS_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/releases/redis-${REDIS_VERSION}.tar.gz; \ + fi && \ tar xvzf redis-${REDIS_VERSION}.tar.gz WORKDIR /tmp/redis-${REDIS_VERSION} diff --git a/Dockerfile.sentinel b/Dockerfile.sentinel index 4d580a1..fff6a55 100644 --- a/Dockerfile.sentinel +++ b/Dockerfile.sentinel @@ -14,7 +14,14 @@ RUN apk add --no-cache su-exec tzdata make curl build-base linux-headers bash op WORKDIR /tmp -RUN curl -fL -Lo redis-${REDIS_SENTINEL_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_SENTINEL_VERSION}.tar.gz && \ +RUN if [ "${REDIS_SENTINEL_VERSION}" = "stable" ]; then \ + curl -fL -Lo redis-${REDIS_SENTINEL_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-stable.tar.gz; \ + else \ + if [ "${REDIS_VERSION:0:1}" = "v" ]; then \ + REDIS_VERSION=${REDIS_VERSION:1}; \ + fi; \ + curl -fL -Lo redis-${REDIS_SENTINEL_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/releases/redis-${REDIS_SENTINEL_VERSION}.tar.gz; \ + fi && \ tar xvzf redis-${REDIS_SENTINEL_VERSION}.tar.gz && \ make -C redis-${REDIS_SENTINEL_VERSION} && \ make -C redis-${REDIS_SENTINEL_VERSION} install BUILD_TLS=yes