Skip to content

Commit

Permalink
chg(images): use prebuilt supervisord image instead of building it ea…
Browse files Browse the repository at this point in the history
…ch time
  • Loading branch information
janosmiko committed May 29, 2024
1 parent f63e054 commit f34f247
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 133 deletions.
1 change: 1 addition & 0 deletions .hadolint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ ignored:
- DL3016 # Pin versions in npm install
- DL3018 # Pin versions in apk install
- DL3007 # Using latest is prone to errors if the image will ever update
- DL3022 # Enable using external sources for COPY
20 changes: 1 addition & 19 deletions images/php-fpm-rootless/magento2-web/tpl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@ ARG BASE_IMAGE_TAG="{{ $BASE_IMAGE_TAG }}"
ARG PHP_VERSION
ARG PHP_VARIANT="magento2"

FROM golang:alpine AS builder-supervisor

WORKDIR /src/

RUN <<-EOF
set -eux
apk add --no-cache \
git \
gcc \
rust
git clone https://github.com/ochinchina/supervisord.git .
if [ "$(apk --print-arch)" = "aarch64" ]; \
then BUILD_ARCH="arm64"; \
else BUILD_ARCH="amd64"; \
fi
CGO_ENABLED=0 GOOS=linux GOARCH=$BUILD_ARCH go build -a -ldflags "-linkmode internal -extldflags -static" -o /usr/local/bin/supervisord github.com/ochinchina/supervisord
EOF

FROM ${IMAGE_NAME}:${PHP_VERSION}-${PHP_VARIANT}-${BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}-rootless
USER root

Expand All @@ -50,7 +32,7 @@ ENV XDEBUG_CONNECT_BACK_HOST '""'
ENV WWWDATA_PASSWORD ""

COPY rootfs/. /
COPY --from=builder-supervisor /usr/local/bin/supervisord /usr/bin/
COPY --from=rewardenv/supervisord /usr/local/bin/supervisord /usr/bin/

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down
20 changes: 1 addition & 19 deletions images/php-fpm-rootless/shopware-web/tpl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@ ARG BASE_IMAGE_TAG="{{ $BASE_IMAGE_TAG }}"
ARG PHP_VERSION
ARG PHP_VARIANT="shopware"

FROM golang:alpine AS builder-supervisor

WORKDIR /src/

RUN <<-EOF
set -eux
apk add --no-cache \
git \
gcc \
rust
git clone https://github.com/ochinchina/supervisord.git .
if [ "$(apk --print-arch)" = "aarch64" ]; \
then BUILD_ARCH="arm64"; \
else BUILD_ARCH="amd64"; \
fi
CGO_ENABLED=0 GOOS=linux GOARCH=$BUILD_ARCH go build -a -ldflags "-linkmode internal -extldflags -static" -o /usr/local/bin/supervisord github.com/ochinchina/supervisord
EOF

FROM ${IMAGE_NAME}:${PHP_VERSION}-${PHP_VARIANT}-${BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}-rootless
USER root

Expand All @@ -50,7 +32,7 @@ ENV XDEBUG_CONNECT_BACK_HOST '""'
ENV WWWDATA_PASSWORD ""

COPY rootfs/. /
COPY --from=builder-supervisor /usr/local/bin/supervisord /usr/bin/
COPY --from=rewardenv/supervisord /usr/local/bin/supervisord /usr/bin/

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down
20 changes: 1 addition & 19 deletions images/php-fpm-rootless/wordpress-web/tpl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@ ARG BASE_IMAGE_TAG="{{ $BASE_IMAGE_TAG }}"
ARG PHP_VERSION
ARG PHP_VARIANT="wordpress"

FROM golang:alpine AS builder-supervisor

WORKDIR /src/

RUN <<-EOF
set -eux
apk add --no-cache \
git \
gcc \
rust
git clone https://github.com/ochinchina/supervisord.git .
if [ "$(apk --print-arch)" = "aarch64" ]; \
then BUILD_ARCH="arm64"; \
else BUILD_ARCH="amd64"; \
fi
CGO_ENABLED=0 GOOS=linux GOARCH=$BUILD_ARCH go build -a -ldflags "-linkmode internal -extldflags -static" -o /usr/local/bin/supervisord github.com/ochinchina/supervisord
EOF

FROM ${IMAGE_NAME}:${PHP_VERSION}-${PHP_VARIANT}-${BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}-rootless
USER root

Expand All @@ -50,7 +32,7 @@ ENV XDEBUG_CONNECT_BACK_HOST '""'
ENV WWWDATA_PASSWORD ""

COPY rootfs/. /
COPY --from=builder-supervisor /usr/local/bin/supervisord /usr/bin/
COPY --from=rewardenv/supervisord /usr/local/bin/supervisord /usr/bin/

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down
20 changes: 1 addition & 19 deletions images/php-fpm/magento2-web/tpl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@ ARG BASE_IMAGE_TAG="{{ $BASE_IMAGE_TAG }}"
ARG PHP_VERSION
ARG PHP_VARIANT="magento2"

FROM golang:alpine AS builder-supervisor

WORKDIR /src/

RUN <<-EOF
set -eux
apk add --no-cache \
git \
gcc \
rust
git clone https://github.com/ochinchina/supervisord.git .
if [ "$(apk --print-arch)" = "aarch64" ]; \
then BUILD_ARCH="arm64"; \
else BUILD_ARCH="amd64"; \
fi
CGO_ENABLED=0 GOOS=linux GOARCH=$BUILD_ARCH go build -a -ldflags "-linkmode internal -extldflags -static" -o /usr/local/bin/supervisord github.com/ochinchina/supervisord
EOF

FROM ${IMAGE_NAME}:${PHP_VERSION}-${PHP_VARIANT}-${BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}
USER root

Expand All @@ -51,7 +33,7 @@ ENV SUDO_ENABLED "false"
ENV WWWDATA_PASSWORD ""

COPY rootfs/. /
COPY --from=builder-supervisor /usr/local/bin/supervisord /usr/bin/
COPY --from=rewardenv/supervisord /usr/local/bin/supervisord /usr/bin/

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down
20 changes: 1 addition & 19 deletions images/php-fpm/shopware-web/tpl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@ ARG BASE_IMAGE_TAG="{{ $BASE_IMAGE_TAG }}"
ARG PHP_VERSION
ARG PHP_VARIANT="shopware"

FROM golang:alpine AS builder-supervisor

WORKDIR /src/

RUN <<-EOF
set -eux
apk add --no-cache \
git \
gcc \
rust
git clone https://github.com/ochinchina/supervisord.git .
if [ "$(apk --print-arch)" = "aarch64" ]; \
then BUILD_ARCH="arm64"; \
else BUILD_ARCH="amd64"; \
fi
CGO_ENABLED=0 GOOS=linux GOARCH=$BUILD_ARCH go build -a -ldflags "-linkmode internal -extldflags -static" -o /usr/local/bin/supervisord github.com/ochinchina/supervisord
EOF

FROM ${IMAGE_NAME}:${PHP_VERSION}-${PHP_VARIANT}-${BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}
USER root

Expand All @@ -51,7 +33,7 @@ ENV SUDO_ENABLED "false"
ENV WWWDATA_PASSWORD ""

COPY rootfs/. /
COPY --from=builder-supervisor /usr/local/bin/supervisord /usr/bin/
COPY --from=rewardenv/supervisord /usr/local/bin/supervisord /usr/bin/

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down
20 changes: 1 addition & 19 deletions images/php-fpm/wordpress-web/tpl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,6 @@ ARG BASE_IMAGE_TAG="{{ $BASE_IMAGE_TAG }}"
ARG PHP_VERSION
ARG PHP_VARIANT="wordpress"

FROM golang:alpine AS builder-supervisor

WORKDIR /src/

RUN <<-EOF
set -eux
apk add --no-cache \
git \
gcc \
rust
git clone https://github.com/ochinchina/supervisord.git .
if [ "$(apk --print-arch)" = "aarch64" ]; \
then BUILD_ARCH="arm64"; \
else BUILD_ARCH="amd64"; \
fi
CGO_ENABLED=0 GOOS=linux GOARCH=$BUILD_ARCH go build -a -ldflags "-linkmode internal -extldflags -static" -o /usr/local/bin/supervisord github.com/ochinchina/supervisord
EOF

FROM ${IMAGE_NAME}:${PHP_VERSION}-${PHP_VARIANT}-${BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}
USER root

Expand All @@ -51,7 +33,7 @@ ENV SUDO_ENABLED "false"
ENV WWWDATA_PASSWORD ""

COPY rootfs/. /
COPY --from=builder-supervisor /usr/local/bin/supervisord /usr/bin/
COPY --from=rewardenv/supervisord /usr/local/bin/supervisord /usr/bin/

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down
20 changes: 1 addition & 19 deletions images/varnish/tpl.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,6 @@ ARG VARNISH_REPO_VERSION={{ $VARNISH_REPO_VERSION }}
ARG VARNISH_MODULES_BRANCH={{ $VARNISH_MODULES_BRANCH }}
ARG DEB_SCRIPT="https://packagecloud.io/install/repositories/varnishcache/varnish${VARNISH_REPO_VERSION}/script.deb.sh"

FROM golang:alpine AS builder-supervisor

WORKDIR /src

RUN <<-EOF
set -eux
apk add --no-cache \
git \
gcc \
rust
git clone https://github.com/ochinchina/supervisord.git .
if [ "$(apk --print-arch)" = "aarch64" ]; \
then BUILD_ARCH="arm64"; \
else BUILD_ARCH="amd64"; \
fi
CGO_ENABLED=0 GOOS=linux GOARCH=$BUILD_ARCH go build -a -ldflags "-linkmode internal -extldflags -static" -o /usr/local/bin/supervisord github.com/ochinchina/supervisord
EOF

FROM {{ $DISTRO }}:{{ $DISTRO_RELEASE | strings.TrimSuffix "-1" }}{{- if eq $DISTRO "debian" }}-slim{{- end }} AS builder

ARG VARNISH_VERSION
Expand Down Expand Up @@ -90,7 +72,7 @@ EOF
FROM {{ $DISTRO }}:{{ $DISTRO_RELEASE | strings.TrimSuffix "-1" }}{{- if eq $DISTRO "debian" }}-slim{{- end }}

COPY --from=builder /usr/lib/varnish/vmods/ /usr/lib/varnish/vmods/
COPY --from=builder-supervisor /usr/local/bin/supervisord /usr/bin/
COPY --from=rewardenv/supervisord /usr/local/bin/supervisord /usr/bin/

ARG VARNISH_VERSION
ARG VARNISH_REPO_VERSION
Expand Down

0 comments on commit f34f247

Please sign in to comment.