Skip to content

Commit

Permalink
Docker files lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Azanul <[email protected]>
  • Loading branch information
Azanul committed Oct 6, 2023
1 parent d0b7256 commit 012c39b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ LABEL maintainer="Opstree Solutions"

ARG TARGETARCH

LABEL VERSION=1.0 \
ARCH=$TARGETARCH \
DESCRIPTION="A production grade performance tuned redis docker image created by Opstree Solutions"
LABEL version=1.0 \
arch=$TARGETARCH \
description="A production grade performance tuned redis docker image created by Opstree Solutions"

ARG REDIS_DOWNLOAD_URL="http://download.redis.io/"

ARG REDIS_VERSION="stable"

RUN apk add --no-cache su-exec tzdata make curl build-base linux-headers bash openssl-dev
RUN apk add --no-cache su-exec=0.2-r3 tzdata=2023c-r1 make=4.4.1-r2 curl=8.3.0-r1 build-base=0.5-r3 \
linux-headers=6.5-r0 bash=5.2.15-r5 openssl-dev=3.1.3-r0

RUN curl -fL -Lo /tmp/redis-${REDIS_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_VERSION}.tar.gz && \
cd /tmp && \
RUN curl -fL -Lo redis-${REDIS_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_VERSION}.tar.gz && \
tar xvzf redis-${REDIS_VERSION}.tar.gz && \
cd redis-${REDIS_VERSION} && \
make && \
make install BUILD_TLS=yes
make -C redis-${REDIS_VERSION} && \
make -C redis-${REDIS_VERSION} install BUILD_TLS=yes

FROM alpine:3.15

Expand All @@ -35,7 +34,7 @@ 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 addgroup -S -g 1000 redis && adduser -S -G redis -u 1000 redis && \
apk add --no-cache bash
apk add --no-cache bash=5.2.15-r5

COPY redis.conf /etc/redis/redis.conf

Expand Down
11 changes: 6 additions & 5 deletions Dockerfile.exporter
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ ARG EXPORTER_URL="https://github.com/oliver006/redis_exporter/releases/download"

ARG REDIS_EXPORTER_VERSION="1.48.0"

RUN apk add --no-cache curl ca-certificates && \
curl -fL -Lo /tmp/redis_exporter-v${REDIS_EXPORTER_VERSION}.linux-$TARGETARCH.tar.gz \
${EXPORTER_URL}/v${REDIS_EXPORTER_VERSION}/redis_exporter-v${REDIS_EXPORTER_VERSION}.linux-$TARGETARCH.tar.gz && \
cd /tmp && tar -xvzf redis_exporter-v${REDIS_EXPORTER_VERSION}.linux-$TARGETARCH.tar.gz && \
mv redis_exporter-v${REDIS_EXPORTER_VERSION}.linux-$TARGETARCH redis_exporter
RUN apk add --no-cache curl=8.3.0-r1 ca-certificates=20230506-r0 && \
curl -fL -Lo redis_exporter.tar.gz \
${EXPORTER_URL}/v${REDIS_EXPORTER_VERSION}/redis_exporter-v${REDIS_EXPORTER_VERSION}.linux-$TARGETARCH.tar.gz && \
tar -xvzf redis_exporter.tar.gz && \
mv redis_exporter-v${REDIS_EXPORTER_VERSION}.linux-$TARGETARCH /redis_exporter


FROM scratch

Expand Down
13 changes: 6 additions & 7 deletions Dockerfile.sentinel
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ ARG REDIS_DOWNLOAD_URL="http://download.redis.io/"

ARG REDIS_SENTINEL_VERSION="stable"

RUN apk add --no-cache su-exec tzdata make curl build-base linux-headers bash openssl-dev
RUN apk add --no-cache su-exec=0.2-r3 tzdata=2023c-r1 make=4.4.1-r2 curl=8.3.0-r1 build-base=0.5-r3 \
linux-headers=6.5-r0 bash=5.2.15-r5 openssl-dev=3.1.3-r0

RUN curl -fL -Lo /tmp/redis-${REDIS_SENTINEL_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_SENTINEL_VERSION}.tar.gz && \
cd /tmp && \
RUN curl -fL -Lo redis-${REDIS_SENTINEL_VERSION}.tar.gz ${REDIS_DOWNLOAD_URL}/redis-${REDIS_SENTINEL_VERSION}.tar.gz && \
tar xvzf redis-${REDIS_SENTINEL_VERSION}.tar.gz && \
cd redis-${REDIS_SENTINEL_VERSION} && \
make && \
make install BUILD_TLS=yes
make -C redis-${REDIS_SENTINEL_VERSION} && \
make -C redis-${REDIS_SENTINEL_VERSION} install BUILD_TLS=yes

FROM alpine:3.15

Expand All @@ -32,7 +31,7 @@ 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 addgroup -S -g 1000 redis && adduser -S -G redis -u 1000 redis && \
apk add --no-cache bash
apk add --no-cache bash=5.2.15-r5

COPY sentinel.conf /etc/redis/sentinel.conf

Expand Down

0 comments on commit 012c39b

Please sign in to comment.