Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
feat(alpine): Change parent image to be alpine based as well (#444)
Browse files Browse the repository at this point in the history
It replaces centos/httpd with alpine/httpd allowing to be smaller/updated and also multi-arch

Change-Id: I7a3050fcfdea30fe08e4127cf581713a9cc91b85
Signed-off-by: Florent Benoit <fbenoit@redhat.com>
  • Loading branch information
benoitf authored Apr 14, 2020
1 parent e8ba7d6 commit f17c759
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions build/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#

# Builder: check meta.yamls and create index.json
FROM alpine:3.10 AS builder
FROM docker.io/alpine:3.11.5 AS builder
RUN apk add --no-cache py-pip jq bash wget skopeo && pip install yq jsonschema

ARG LATEST_ONLY=false
Expand All @@ -34,17 +34,20 @@ RUN ./list_referenced_images.sh v3 > /build/v3/external_images.txt
RUN chmod -R g+rwX /build

# Build registry, copying meta.yamls and index.json from builder
FROM registry.centos.org/centos/httpd-24-centos7 AS registry
COPY README.md .htaccess /var/www/html/
COPY --from=builder /build/v3 /var/www/html/v3
FROM docker.io/httpd:2.4.43-alpine AS registry
# Allow htaccess
RUN sed -i 's| AllowOverride None| AllowOverride All|' /usr/local/apache2/conf/httpd.conf && \
mkdir -p /var/www && ln -s /usr/local/apache2/htdocs /var/www/html
COPY README.md .htaccess /usr/local/apache2/htdocs/
COPY --from=builder /build/v3 /usr/local/apache2/htdocs/v3
COPY ./build/dockerfiles/entrypoint.sh /usr/bin/
ENTRYPOINT ["/usr/bin/entrypoint.sh"]
CMD ["/usr/bin/run-httpd"]
CMD ["httpd-foreground"]

# Offline build: cache .theia and .vsix files in registry itself and update metas
FROM builder AS offline-builder
RUN ./cache_artifacts.sh v3 && chmod -R g+rwX /build

# Offline registry: copy updated meta.yamls and cached extensions
FROM registry AS offline-registry
COPY --from=offline-builder /build/v3 /var/www/html/v3
COPY --from=offline-builder /build/v3 /usr/local/apache2/htdocs/v3

0 comments on commit f17c759

Please sign in to comment.