Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit 8426c2b

Browse files
committed
Base images on php-alpine
see https://github.com/codecasts/php-alpine
1 parent e53717e commit 8426c2b

File tree

5 files changed

+52
-49
lines changed

5 files changed

+52
-49
lines changed

Makefile

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ all: php test-php
66

77
.PHONY: php
88
php:
9-
docker build --build-arg ALPINE_VERSION=3.11 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php -t kreait/php:7.3 -f php/Dockerfile php
10-
docker build --build-arg ALPINE_VERSION=3.11 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-dev -t kreait/php:7.3-dev -f php/Dockerfile php
11-
docker build --build-arg ALPINE_VERSION=3.11 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm -t kreait/php:7.3-fpm -f php/Dockerfile php
12-
docker build --build-arg ALPINE_VERSION=3.11 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm-dev -t kreait/php:7.3-fpm-dev -f php/Dockerfile php
13-
14-
docker build --build-arg ALPINE_VERSION=edge --build-arg VCS_REF=`git rev-parse --short HEAD` --target php -t kreait/php:7.4 -f php/Dockerfile php
15-
docker build --build-arg ALPINE_VERSION=edge --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-dev -t kreait/php:7.4-dev -f php/Dockerfile php
16-
docker build --build-arg ALPINE_VERSION=edge --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm -t kreait/php:7.4-fpm -f php/Dockerfile php
17-
docker build --build-arg ALPINE_VERSION=edge --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm-dev -t kreait/php:7.4-fpm-dev -f php/Dockerfile php
9+
docker build --build-arg ALPINE_VERSION=3.11 --build-arg PHP_VERSION=7.3 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php -t kreait/php:7.3 -f php/Dockerfile php
10+
docker build --build-arg ALPINE_VERSION=3.11 --build-arg PHP_VERSION=7.3 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-dev -t kreait/php:7.3-dev -f php/Dockerfile php
11+
docker build --build-arg ALPINE_VERSION=3.11 --build-arg PHP_VERSION=7.3 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm -t kreait/php:7.3-fpm -f php/Dockerfile php
12+
docker build --build-arg ALPINE_VERSION=3.11 --build-arg PHP_VERSION=7.3 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm-dev -t kreait/php:7.3-fpm-dev -f php/Dockerfile php
13+
14+
docker build --build-arg ALPINE_VERSION=3.12 --build-arg PHP_VERSION=7.4 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php -t kreait/php:7.4 -f php/Dockerfile php
15+
docker build --build-arg ALPINE_VERSION=3.12 --build-arg PHP_VERSION=7.4 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-dev -t kreait/php:7.4-dev -f php/Dockerfile php
16+
docker build --build-arg ALPINE_VERSION=3.12 --build-arg PHP_VERSION=7.4 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm -t kreait/php:7.4-fpm -f php/Dockerfile php
17+
docker build --build-arg ALPINE_VERSION=3.12 --build-arg PHP_VERSION=7.4 --build-arg VCS_REF=`git rev-parse --short HEAD` --target php-fpm-dev -t kreait/php:7.4-fpm-dev -f php/Dockerfile php
1818

1919
.PHONY: test-php
2020
test-php:

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
## PHP
77

8-
Docker images built on top of Alpine Linux with the latest stable PHP Version and common and useful extensions.
8+
Docker images built on top of Alpine Linux with the [latest stable PHP Version and common extensions](https://github.com/codecasts/php-alpine).
99

1010
The images are automatically re-built and published on a weekly basis.
1111

@@ -29,11 +29,11 @@ All the images are pre-built with a user `www-data` and a group with the same na
2929
**Specify a --user name and set the working directory on docker runs, e.g.:**
3030

3131
```bash
32-
docker run --user www-data -w /home/www-data --rm kreait/php:7.3-dev bash -c "php -v | grep 'Xdebug'"
32+
docker run --user www-data -w /home/www-data --rm kreait/php:7.4-dev bash -c "php -v | grep 'Xdebug'"
3333
```
3434

3535
Confirm it by running:
3636

3737
```bash
38-
docker run --user www-data -w /home/www-data --rm kreait/php:7.3-dev bash -c "id ; env"
38+
docker run --user www-data -w /home/www-data --rm kreait/php:7.4-dev bash -c "id ; env"
3939
```

php/Dockerfile

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
ARG ALPINE_VERSION
2-
ARG VCS_REF
32

43
###########################################################
54

65
FROM alpine:${ALPINE_VERSION} as base
76

7+
ARG ALPINE_VERSION
8+
ARG PHP_VERSION
9+
ARG VCS_REF
10+
811
LABEL maintainer="Jérôme Gamez <[email protected]>" \
912
org.label-schema.vcs-ref=$VCS_REF \
1013
org.label-schema.vcs-url="https://github.com/kreait/docker-images"
1114

1215
COPY docker /docker/
1316

14-
# See https://github.com/gliderlabs/docker-alpine/issues/184
15-
RUN \
16-
sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories && \
17-
apk update && apk upgrade
17+
ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
1818

19-
RUN /docker/scripts/install-packages.sh \
19+
RUN apk --update-cache add ca-certificates \
20+
&& echo https://dl.bintray.com/php-alpine/v$ALPINE_VERSION/php-$PHP_VERSION >> /etc/apk/repositories \
21+
# See https://github.com/gliderlabs/docker-alpine/issues/184
22+
&& sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories \
23+
&& apk update && apk upgrade \
24+
&& /docker/scripts/install-packages.sh \
2025
&& /docker/scripts/ensure-www-data.sh \
2126
&& mv /docker/php-entrypoint /usr/local/bin/
2227

php/docker/scripts/install-dev-packages.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
set -ex
33

44
apk --no-cache add \
5-
php7-xdebug
5+
php-xdebug
66

7-
sed -i 's/;zend_extension/zend_extension/' /etc/php7/conf.d/{50_,}xdebug.ini || true
7+
sed -i 's/;zend_extension/zend_extension/' /etc/php7/conf.d/00_xdebug.ini

php/docker/scripts/install-packages.sh

+27-29
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,30 @@ set -ex
44
apk --no-cache add \
55
bash \
66
zip unzip \
7-
php7 \
8-
php7-ctype \
9-
php7-curl \
10-
php7-dom \
11-
php7-fileinfo \
12-
php7-ftp \
13-
php7-gd \
14-
php7-iconv \
15-
php7-intl \
16-
php7-json \
17-
php7-mbstring \
18-
php7-mysqlnd \
19-
php7-openssl \
20-
php7-pdo \
21-
php7-pdo_sqlite \
22-
php7-pdo_mysql \
23-
php7-pdo_pgsql \
24-
php7-pear \
25-
php7-phar \
26-
php7-posix \
27-
php7-session \
28-
php7-simplexml \
29-
php7-sqlite3 \
30-
php7-tokenizer \
31-
php7-xml \
32-
php7-xmlreader \
33-
php7-xmlwriter \
34-
php7-zip \
35-
php7-zlib
7+
php \
8+
php-ctype \
9+
php-curl \
10+
php-dom \
11+
php-ftp \
12+
php-gd \
13+
php-iconv \
14+
php-intl \
15+
php-json \
16+
php-mbstring \
17+
php-mysqlnd \
18+
php-openssl \
19+
php-pdo \
20+
php-pdo_sqlite \
21+
php-pdo_mysql \
22+
php-pdo_pgsql \
23+
php-pear \
24+
php-phar \
25+
php-posix \
26+
php-session \
27+
php-sqlite3 \
28+
php-xml \
29+
php-xmlreader \
30+
php-zip \
31+
php-zlib
32+
33+
ln -s /usr/bin/php7 /usr/bin/php

0 commit comments

Comments
 (0)