php/5/Dockerfile.apache-alpine

69 lines
1.8 KiB
Docker

# PHP 5.6 == 3.5
ARG OS_VERSION=3.5
FROM quay.io/sindigilive/alpine:${OS_VERSION} AS builder
LABEL maintainer="<Muhamad Aditya Prima> map@sindigilive.com"
ARG FLAVOR=cli
ARG WITH_APACHE=false
ARG PHP_VERSION=5.6
ARG PHP_VER_SHORT=5
ENV FLAVOR=${FLAVOR}
ENV WITH_APACHE=${WITH_APACHE}
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
WORKDIR /root
ADD 5/scripts/alpine-setup.sh /tmp/setup.sh
ADD scripts/entrypoint.sh /usr/local/bin
# Create directory, and install required php app
RUN /bin/mkdir -p /app ; \
/sbin/apk add --update --no-cache \
php${PHP_VER_SHORT} php${PHP_VER_SHORT}-common \
php${PHP_VER_SHORT}-cli ; \
/bin/chmod +x /tmp/setup.sh /usr/local/bin/entrypoint.sh ; \
/bin/sh /tmp/setup.sh; \
/bin/rm -f /tmp/*.sh;
ADD htdocs /app/htdocs
# Create symlinks to /usr/bin/php in case it doesn't exists
RUN ln -ns /usr/bin/php${PHP_VER_SHORT} /usr/bin/php ; exit 0
# CLEAN APK CACHES
RUN sed -i "s|#version#|${PHP_VERSION}|" /app/htdocs/index.html ; \
sed -i "s|#os#|alpine|" /app/htdocs/index.html ; \
sed -i "s|#flavor#|${FLAVOR}|" /app/htdocs/index.html ; \
chown apache:apache /app/htdocs; \
rm -vrf /var/cache/apk/*
FROM scratch
ARG PHP_VERSION=5.6
ARG PHP_VER_SHORT=5
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_VER_SHORT=${PHP_VER_SHORT}
LABEL maintainer="Muhamad Aditya Prima <map@sindigilive.com>"
LABEL name="php"
LABEL version="${PHP_VERSION}"
LABEL distribution-scope="public"
#labels for container catalog
LABEL summary="PHP ${PHP_VERSION} on alpine based container image"
LABEL description="Provide php on alpine based container base image"
LABEL io.k8s.description="Very small alpine linux container image"
LABEL io.k8s.display-name="PHP ${PHP_VERSION}"
COPY --from=builder / /
WORKDIR /app
STOPSIGNAL SIGQUIT
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]