From d2140f25e8c58e809794db1c39e177ffcb3eb366 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Thu, 15 Oct 2020 14:55:41 +0200
Subject: [PATCH] docker/l3d#46 Change base image

---
 CHANGELOG  |  3 ++-
 Dockerfile | 38 +++++++++-----------------------------
 2 files changed, 11 insertions(+), 30 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 666dd5a..9c67c42 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
-v1.5.0 2020-10-15
+v1.5.1 2020-10-15
 -----------------
 Add container for PHP 7.4
+Change build strategy: use PHP-Alpine image instead of vanilla Alpine
 
 v1.4.4 2020-05-22
 -----------------
diff --git a/Dockerfile b/Dockerfile
index 15beadd..d0b9e8d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,7 @@
 ARG ALPINE_VERSION
+ARG PHP_VERSION
 
-FROM alpine:${ALPINE_VERSION}
+FROM php:${PHP_VERSION}-cli-alpine${ALPINE_VERSION}
 
 ARG VERSION
 
@@ -49,7 +50,7 @@ RUN echo 'hosts: files dns' > /etc/nsswitch.conf && \
     echo "StrictHostKeyChecking no" >> /root/.ssh/config && \
     \
     apk update && \
-    apk add --no-cache mdocml-apropos openssh wget make patch bash fish python3 git git-lfs unzip acl && \
+    apk add --no-cache mdocml-apropos openssh wget make patch bash fish python3 git git-lfs unzip acl libpng-dev libzip-dev gnu-libiconv && \
     \
     wget -q https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -O /etc/apk/keys/sgerrand.rsa.pub && \
     wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${glibc_version}/glibc-${glibc_version}.apk && \
@@ -78,34 +79,13 @@ RUN echo 'hosts: files dns' > /etc/nsswitch.conf && \
     cd .. && \
     rm -rf git-extras && \
     \
-    cp /etc/apk/repositories /etc/apk/repositories.org && \
-    echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
-    echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories && \
-    apk update && \
-    apk add --no-cache \
-        php7 php7-phar php7-json php7-dom php7-gd php7-mbstring php7-openssl \
-        php7-pdo php7-curl php7-xml php7-zip php7-session php7-ctype php7-iconv \
-        php7-bcmath && \
-    if [ "${PHP_VERSION}" = "7.0" ]; then \
-      echo "no extra packages required" ; \
-    else \
-      apk add --no-cache php7-fileinfo php7-tokenizer php7-simplexml php7-xmlreader php7-xmlwriter ; \
-    fi && \
-    if [ "${PHP_VERSION}" = "7.2" ]; then \
-      apk add --no-cache php7-sodium ; \
-    fi && \
-    if [ "${PHP_VERSION}" = "7.3" ]; then \
-      apk add --no-cache php7-sodium gnu-libiconv ; \
-    fi && \
-    if [ "${PHP_VERSION}" = "7.4" ]; then \
-      apk add --no-cache php7-sodium gnu-libiconv ; \
-    fi && \
-    rm /etc/apk/repositories && \
-    mv /etc/apk/repositories.org /etc/apk/repositories && \
-    apk update && \
+    docker-php-ext-install \
+      bcmath \
+      gd \
+      zip && \
     \
-    sed -i -e 's/memory_limit = 128M/memory_limit = -1/g' /etc/php7/php.ini && \
-    ln -s /usr/bin/php7 /usr/local/bin/php && \
+    mv /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini && \
+    sed -i -e 's/memory_limit = 128M/memory_limit = -1/g' /usr/local/etc/php/php.ini && \
     \
     composer selfupdate && \
     composer global require "hirak/prestissimo:^0.3" && \
-- 
GitLab