Files
whp-default-container/Dockerfile
T
shadowdaoandClaude Opus 5.5 6eed6aa615 ci: pin httpd:alpine by Docker Hub digest; pull it via the pkg-cache registry mirror
CI resolves httpd:alpine to httpd@sha256:<digest> directly at
registry-1.docker.io (.gitea/scripts/resolve-base-image.sh) and passes it
as BASE_IMAGE. Only when the base is digest-pinned AND the pkg-cache
registry mirror (192.168.1.40:5000) answers over TLS with the pinned CA
is the buildx builder configured with the mirror; otherwise Docker Hub
direct as before. The image installs no OS packages, so no PKG_CACHE
build-arg / pkg-cache-repos.sh is needed; keys/pkg-cache/ is carried for
the CA (identical copy of cloud-apache-container's).

Local builds without build-args still use httpd:alpine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 07:15:31 -07:00

26 lines
1.0 KiB
Docker

# Base image. CI passes BASE_IMAGE=httpd@sha256:<digest>, resolved DIRECTLY
# from Docker Hub in the same run (.gitea/scripts/resolve-base-image.sh), so the
# pkg-cache registry mirror can only serve content-addressed blobs. Local builds
# use the tag. Canonical docs: cloud-apache-container docs/pkg-cache.md.
ARG BASE_IMAGE=httpd:alpine
FROM ${BASE_IMAGE}
# Enable .htaccess files by modifying Apache configuration
RUN sed -i '/<Directory "\/usr\/local\/apache2\/htdocs">/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /usr/local/apache2/conf/httpd.conf
# Enable mod_rewrite module (commonly used in .htaccess)
RUN sed -i 's/#LoadModule rewrite_module/LoadModule rewrite_module/' /usr/local/apache2/conf/httpd.conf
# Copy the default landing page to the container
COPY index.html /index.html
RUN rm -f /usr/local/apache2/htdocs/index.html
# Copy the startup script
COPY scripts/startup.sh /startup.sh
# Make the startup script executable
RUN chmod +x /startup.sh
# Set the startup script as the entrypoint
ENTRYPOINT ["/startup.sh"]