Skip to content

Commit 24c6203

Browse files
authored
Merge pull request #123 from undecaf/dev-2004
Add Ubuntu 20.04 PHP 7.4/8.0, add PHP 8.0 to 18.04
2 parents c3f1244 + 63b7b4b commit 24c6203

File tree

19 files changed

+312
-122
lines changed

19 files changed

+312
-122
lines changed

.circleci/config.yml

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
version: 2
22
jobs:
33
test:
4-
machine: true
4+
machine:
5+
image: ubuntu-2004:202107-02
56
steps:
67
- checkout
78
- run: |
@@ -10,50 +11,67 @@ jobs:
1011
make test
1112
1213
deploy:
13-
machine: true
14+
machine:
15+
image: ubuntu-2004:202107-02
1416
steps:
1517
- checkout
1618
- run: |
1719
docker login -u $DOCKER_USER -p $DOCKER_PASS
1820
docker-compose -f docker-compose.test.yml -p ci build
19-
docker tag ci_web1804-php7:latest mattrayner/lamp:latest
20-
docker tag ci_web1804-php7:latest mattrayner/lamp:latest-1804
21+
docker tag ci_web2004-php8:latest mattrayner/lamp:latest
22+
docker tag ci_web2004-php8:latest mattrayner/lamp:latest-2004
23+
docker tag ci_web2004-php8:latest mattrayner/lamp:latest-2004-php8
24+
docker tag ci_web2004-php7:latest mattrayner/lamp:latest-2004-php7
25+
docker tag ci_web2004-php8:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM
26+
docker tag ci_web2004-php8:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-2004
27+
docker tag ci_web2004-php8:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-2004-php8
28+
docker tag ci_web2004-php7:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-2004-php7
29+
30+
docker tag ci_web1804-php8:latest mattrayner/lamp:latest-1804
31+
docker tag ci_web1804-php8:latest mattrayner/lamp:latest-1804-php8
2132
docker tag ci_web1804-php7:latest mattrayner/lamp:latest-1804-php7
22-
docker tag ci_web1604-php7:latest mattrayner/lamp:latest-1604
23-
docker tag ci_web1604-php7:latest mattrayner/lamp:latest-1604-php7
24-
docker tag ci_web1804-php7:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM
25-
docker tag ci_web1804-php7:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1804
33+
docker tag ci_web1804-php8:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1804
34+
docker tag ci_web1804-php8:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1804-php8
2635
docker tag ci_web1804-php7:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1804-php7
27-
docker tag ci_web1604-php7:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1604
28-
docker tag ci_web1604-php7:latest mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1604-php7
36+
2937
docker push mattrayner/lamp:latest
38+
docker push mattrayner/lamp:latest-2004
39+
docker push mattrayner/lamp:latest-2004-php8
40+
docker push mattrayner/lamp:latest-2004-php7
3041
docker push mattrayner/lamp:latest-1804
42+
docker push mattrayner/lamp:latest-1804-php8
3143
docker push mattrayner/lamp:latest-1804-php7
32-
docker push mattrayner/lamp:latest-1604
33-
docker push mattrayner/lamp:latest-1604-php7
3444
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM
45+
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM-2004
46+
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM-2004-php7
47+
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM-2004-php8
3548
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1804
3649
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1804-php7
37-
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1604
38-
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1604-php7
50+
docker push mattrayner/lamp:build-$CIRCLE_BUILD_NUM-1804-php8
3951
4052
deploy-tags:
41-
machine: true
53+
machine:
54+
image: ubuntu-2004:202107-02
4255
steps:
4356
- checkout
4457
- run: |
4558
docker login -u $DOCKER_USER -p $DOCKER_PASS
4659
docker-compose -f docker-compose.test.yml -p ci build
47-
docker tag ci_web1804-php7:latest mattrayner/lamp:$CIRCLE_TAG
48-
docker tag ci_web1804-php7:latest mattrayner/lamp:$CIRCLE_TAG-1804
60+
docker tag ci_web2004-php8:latest mattrayner/lamp:$CIRCLE_TAG
61+
docker tag ci_web2004-php8:latest mattrayner/lamp:$CIRCLE_TAG-2004
62+
docker tag ci_web2004-php7:latest mattrayner/lamp:$CIRCLE_TAG-2004-php7
63+
docker tag ci_web2004-php8:latest mattrayner/lamp:$CIRCLE_TAG-2004-php8
64+
docker tag ci_web1804-php8:latest mattrayner/lamp:$CIRCLE_TAG-1804
4965
docker tag ci_web1804-php7:latest mattrayner/lamp:$CIRCLE_TAG-1804-php7
50-
docker tag ci_web1604-php7:latest mattrayner/lamp:$CIRCLE_TAG-1604
51-
docker tag ci_web1604-php7:latest mattrayner/lamp:$CIRCLE_TAG-1604-php7
66+
docker tag ci_web1804-php8:latest mattrayner/lamp:$CIRCLE_TAG-1804-php8
67+
5268
docker push mattrayner/lamp:$CIRCLE_TAG
69+
docker push mattrayner/lamp:$CIRCLE_TAG-2004
70+
docker push mattrayner/lamp:$CIRCLE_TAG-2004-php7
71+
docker push mattrayner/lamp:$CIRCLE_TAG-2004-php8
5372
docker push mattrayner/lamp:$CIRCLE_TAG-1804
5473
docker push mattrayner/lamp:$CIRCLE_TAG-1804-php7
55-
docker push mattrayner/lamp:$CIRCLE_TAG-1604
56-
docker push mattrayner/lamp:$CIRCLE_TAG-1604-php7
74+
docker push mattrayner/lamp:$CIRCLE_TAG-1804-php8
5775
5876
workflows:
5977
version: 2

1804/Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
FROM phusion/baseimage:0.11
22
MAINTAINER Matthew Rayner <[email protected]>
3-
ENV REFRESHED_AT 2019-06-11
3+
ENV REFRESHED_AT 2021-09-08
44

55
# based on dgraziotin/lamp
66
# MAINTAINER Daniel Graziotin <[email protected]>
7+
# updated for PHP 8.0 Ferdinand Kasper <[email protected]>
78

89
ENV DOCKER_USER_ID 501
910
ENV DOCKER_USER_GID 20
1011

1112
ENV BOOT2DOCKER_ID 1000
1213
ENV BOOT2DOCKER_GID 50
1314

14-
ENV PHPMYADMIN_VERSION=5.0.2
15-
ENV SUPERVISOR_VERSION=4.2.0
15+
ENV PHPMYADMIN_VERSION=5.1.1
16+
ENV SUPERVISOR_VERSION=4.2.2
17+
18+
ARG PHP_VERSION
19+
ENV PHP_VERSION=$PHP_VERSION
1620

1721
# Tweaks to give Apache/PHP write permissions to the app
1822
RUN usermod -u ${BOOT2DOCKER_ID} www-data && \
@@ -28,10 +32,11 @@ RUN add-apt-repository -y ppa:ondrej/php && \
2832
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C && \
2933
apt-get update && \
3034
apt-get -y upgrade && \
31-
apt-get -y install postfix python3-setuptools wget git apache2 php-xdebug libapache2-mod-php mysql-server php-mysql pwgen php-apcu php-gd php-xml php-mbstring php-gettext zip unzip php-zip curl php-curl && \
35+
apt-get -y install postfix python3-setuptools wget git apache2 php${PHP_VERSION}-xdebug libapache2-mod-php${PHP_VERSION} mysql-server php${PHP_VERSION}-mysql pwgen php${PHP_VERSION}-apcu php${PHP_VERSION}-gd php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring zip unzip php${PHP_VERSION}-zip curl php${PHP_VERSION}-curl && \
3236
apt-get -y autoremove && \
37+
apt-get -y clean && \
3338
echo "ServerName localhost" >> /etc/apache2/apache2.conf
34-
39+
3540
# Install supervisor 4
3641
RUN curl -L https://pypi.io/packages/source/s/supervisor/supervisor-${SUPERVISOR_VERSION}.tar.gz | tar xvz && \
3742
cd supervisor-${SUPERVISOR_VERSION}/ && \
@@ -45,7 +50,6 @@ RUN chmod 755 /*.sh
4550
ADD supporting_files/supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
4651
ADD supporting_files/supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
4752
ADD supporting_files/supervisord.conf /etc/supervisor/supervisord.conf
48-
ADD supporting_files/mysqld_innodb.cnf /etc/mysql/conf.d/mysqld_innodb.cnf
4953

5054
# Remove pre-installed database
5155
RUN rm -rf /var/lib/mysql
@@ -77,7 +81,6 @@ ADD app/ /app
7781
#Environment variables to configure php
7882
ENV PHP_UPLOAD_MAX_FILESIZE 10M
7983
ENV PHP_POST_MAX_SIZE 10M
80-
ENV PHP_VERSION 7.4
8184

8285
# Add volumes for the app and MySql
8386
VOLUME ["/var/lib/mysql", "/app" ]

1604/Dockerfile renamed to 2004/Dockerfile

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
1-
FROM phusion/baseimage:0.10.2
1+
FROM phusion/baseimage:focal-1.1.0
22
MAINTAINER Matthew Rayner <[email protected]>
3-
ENV REFRESHED_AT 2019-06-11
3+
ENV REFRESHED_AT 2021-09-07
44

55
# based on dgraziotin/lamp
66
# MAINTAINER Daniel Graziotin <[email protected]>
7+
# updated for Ubuntu 20.04 LTS/PHP 7.4/PHP 8.0 Ferdinand Kasper <[email protected]>
78

89
ENV DOCKER_USER_ID 501
910
ENV DOCKER_USER_GID 20
1011

1112
ENV BOOT2DOCKER_ID 1000
1213
ENV BOOT2DOCKER_GID 50
1314

14-
ENV PHPMYADMIN_VERSION=5.0.2
15-
ENV SUPERVISOR_VERSION=4.2.0
15+
ENV PHPMYADMIN_VERSION=5.1.1
16+
ENV SUPERVISOR_VERSION=4.2.2
17+
18+
ARG PHP_VERSION
19+
ENV PHP_VERSION=$PHP_VERSION
1620

1721
# Tweaks to give Apache/PHP write permissions to the app
1822
RUN usermod -u ${BOOT2DOCKER_ID} www-data && \
1923
usermod -G staff www-data && \
2024
useradd -r mysql && \
21-
usermod -G staff mysql
22-
23-
RUN groupmod -g $(($BOOT2DOCKER_GID + 10000)) $(getent group $BOOT2DOCKER_GID | cut -d: -f1)
24-
RUN groupmod -g ${BOOT2DOCKER_GID} staff
25+
usermod -G staff mysql && \
26+
groupmod -g $(($BOOT2DOCKER_GID + 10000)) $(getent group $BOOT2DOCKER_GID | cut -d: -f1) && \
27+
groupmod -g ${BOOT2DOCKER_GID} staff
2528

2629
# Install packages
2730
ENV DEBIAN_FRONTEND noninteractive
28-
RUN add-apt-repository -y ppa:ondrej/php && \
31+
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php && \
2932
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C && \
3033
apt-get update && \
31-
apt-get -o Dpkg::Options::="--force-confnew" --force-yes -fuy upgrade && \
32-
apt-get -y install postfix python3-setuptools wget git apache2 php-xdebug libapache2-mod-php mysql-server php-mysql pwgen php-apcu php-gd php-xml php-mbstring php-gettext zip unzip php-zip curl php-curl && \
34+
apt-get -y upgrade && \
35+
apt-get -y install postfix python3-setuptools wget git apache2 php${PHP_VERSION}-xdebug libapache2-mod-php${PHP_VERSION} mysql-server php${PHP_VERSION}-mysql pwgen php${PHP_VERSION}-apcu php${PHP_VERSION}-gd php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring zip unzip php${PHP_VERSION}-zip curl php${PHP_VERSION}-curl && \
3336
apt-get -y autoremove && \
37+
apt-get -y clean && \
3438
echo "ServerName localhost" >> /etc/apache2/apache2.conf
3539

3640
# Install supervisor 4
@@ -46,7 +50,6 @@ RUN chmod 755 /*.sh
4650
ADD supporting_files/supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
4751
ADD supporting_files/supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
4852
ADD supporting_files/supervisord.conf /etc/supervisor/supervisord.conf
49-
ADD supporting_files/mysqld_innodb.cnf /etc/mysql/conf.d/mysqld_innodb.cnf
5053

5154
# Remove pre-installed database
5255
RUN rm -rf /var/lib/mysql

README.md

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ![Docker-LAMP][logo]
2-
Docker-LAMP is a set of docker images that include the phusion baseimage (16.04 and 18.04 varieties), along with a LAMP stack ([Apache][apache], [MySQL][mysql] and [PHP][php]) all in one handy package.
2+
Docker-LAMP is a set of docker images that include the phusion baseimage (18.04 and 20.04 varieties), along with a LAMP stack ([Apache][apache], [MySQL][mysql] and [PHP][php]) all in one handy package.
33

4-
With Ubuntu **18.04** amd **16.04** images on the `latest-1804` and `latest-1604` tags, Docker-LAMP is flexible enough to use with all of your LAMP projects.
4+
With Ubuntu **20.04** and **18.04** images on the `latest-2004` and `latest-1804` tags, Docker-LAMP is flexible enough to use with all of your LAMP projects.
55

66
[![Build Status][shield-build-status]][info-build-status]
77
[![Docker Hub][shield-docker-hub]][info-docker-hub]
@@ -46,40 +46,49 @@ As a developer, part of my day to day role is to build LAMP applications. I sear
4646

4747
To complicate things even further I needed an image, or actually two, that would run my applications on both 14.04 and 16.04. Having two entirely separate workflows didn't make any sense to me, and Docker-LAMP was born.
4848

49-
Designed to be a single interface that just 'gets out of your way', and works on 14.04 and 16.04 with php 5 and 7. You can move between all 4 images without changing how you work with Docker.
49+
Designed to be a single interface that just 'gets out of your way', and works on 18.04 and 20.04 with php 7 and 8. You can move between all images without changing how you work with Docker.
5050

5151
## Image Versions
52-
> **NOTE:** [PHP 5.6 is end of life][end-of-life], so the PHP 5 images `mattrayner/lamp:latest-1404-php5` and `mattrayner/lamp:latest-1604-php5` will not receive any updates. Although these images will stay on Docker Hub, we **strongly** recommend updating you applications to PHP7.
52+
> **NOTE:** [PHP 5.6 is end of life][end-of-life], so the PHP 5 images `mattrayner/lamp:latest-1404-php5` and `mattrayner/lamp:latest-1604-php5` will not receive any updates. Although these images will stay on Docker Hub, we **strongly** recommend updating you applications to PHP 7 or PHP 8.
5353
54-
> **NOTE**: The 14.04 variant of this image is no longer being actively supported for updated
54+
> **NOTE**: The 14.04 and 16.04 variants of this image are no longer being actively supported or updated.
5555
56-
There are 3 main 'versions' of the docker image. The table below shows the different tags you can use, along with the PHP, MySQL and Apache versions that come with it.
56+
There are four main 'versions' of the docker image. The table below shows the different tags you can use, along with the PHP, MySQL and Apache versions that come with it.
5757

58-
Component | `latest-1404` | `latest-1604` | `latest-1804`
59-
---|---|---|---
60-
[Apache][apache] | `2.4.7` | `2.4.18` | `2.4.29`
61-
[MySQL][mysql] | `5.5.62` | `5.7.30` | `5.7.30`
62-
[PHP][php] | `7.3.3` | `7.4.6` | `7.4.6`
63-
[phpMyAdmin][phpmyadmin] | `4.8.5` | `5.0.2` | `5.0.2`
58+
Component | `latest-1404` | `latest-1604` | `latest-1804-php7` `latest-1804-php8` | `latest-2004-php7` `latest-2004-php8`
59+
---|---|---|---|---
60+
[Apache][apache] | `2.4.7` | `2.4.18` | `2.4.29` | `2.4.41`
61+
[MySQL][mysql] | `5.5.62` | `5.7.30` | `5.7.35` | `8.0.26`
62+
[PHP][php] | `7.3.3` | `7.4.6` | `7.4.23`/`8.0.10` | `7.4.23`/`8.0.10`
63+
[phpMyAdmin][phpmyadmin] | `4.8.5` | `5.0.2` | `5.1.1` | `5.1.1`
6464

6565

6666
## Using the image
6767
### On the command line
6868
This is the quickest way
6969
```bash
70-
# Launch a 18.04 based image
71-
docker run -p "80:80" -v ${PWD}/app:/app mattrayner/lamp:latest-1804
70+
# Launch a 20.04 based image with PHP 8
71+
docker run -p "80:80" -v ${PWD}/app:/app mattrayner/lamp:latest-2004-php8
7272

73-
# Launch a 16.04 based image
73+
# Launch a 20.04 based image with PHP 7
74+
docker run -p "80:80" -v ${PWD}/app:/app mattrayner/lamp:latest-2004-php7
75+
76+
# Launch a 18.04 based image with PHP 8
77+
docker run -p "80:80" -v ${PWD}/app:/app mattrayner/lamp:latest-1804-php8
78+
79+
# Launch a 18.04 based image with PHP 7
80+
docker run -p "80:80" -v ${PWD}/app:/app mattrayner/lamp:latest-1804-php7
81+
82+
# Launch a 16.04 based image with PHP 7
7483
docker run -p "80:80" -v ${PWD}/app:/app mattrayner/lamp:latest-1604
7584

76-
# Launch a 14.04 based image
85+
# Launch a 14.04 based image with PHP 5
7786
docker run -p "80:80" -v ${PWD}/app:/app mattrayner/lamp:latest-1404
7887
```
7988

8089
### With a Dockerfile
8190
```docker
82-
FROM mattrayner/lamp:latest-1804
91+
FROM mattrayner/lamp:latest-2004-php8
8392
8493
# Your custom commands
8594
@@ -189,15 +198,17 @@ git clone https://github.com/mattrayner/docker-lamp.git
189198
cd docker-lamp
190199

191200
# Build the images
192-
docker build -t=mattrayner/lamp:latest -f ./1804/Dockerfile .
193-
docker build -t=mattrayner/lamp:latest-1604 -f ./1604/Dockerfile .
194-
docker build -t=mattrayner/lamp:latest-1804 -f ./1804/Dockerfile .
201+
docker build --build-arg PHP_VERSION=8.0 -t=mattrayner/lamp:latest -f ./2004/Dockerfile .
202+
docker build --build-arg PHP_VERSION=8.0 -t=mattrayner/lamp:latest-2004-php8 -f ./2004/Dockerfile .
203+
docker build --build-arg PHP_VERSION=7.4 -t=mattrayner/lamp:latest-2004-php7 -f ./2004/Dockerfile .
204+
docker build --build-arg PHP_VERSION=8.0 -t=mattrayner/lamp:latest-1804-php8 -f ./1804/Dockerfile .
205+
docker build --build-arg PHP_VERSION=7.4 -t=mattrayner/lamp:latest-1804-php7 -f ./1804/Dockerfile .
195206

196207
# Run the image as a container
197-
docker run -d -p "3000:80" mattrayner/lamp:latest-1804
208+
docker run -d -p "3000:80" mattrayner/lamp:latest
198209

199210
# Sleep to allow the container to boot
200-
sleep 5
211+
sleep 30
201212

202213
# Curl out the contents of our new container
203214
curl "http://$(docker-machine ip):3000/"
@@ -218,7 +229,7 @@ So what does this command do?
218229
First, build that latest version of our docker-compose images.
219230

220231
#### `docker-compose -f docker-compose.test.yml -p ci up -d;`
221-
Launch our docker containers (`web1804` and `web1604`) in daemon mode.
232+
Launch our docker containers (`web2004-php8` etc.) in daemon mode.
222233

223234
#### `cd tests && ./test.sh;`
224235
Change into the test directory and run out tests

docker-compose.test.yml

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,59 @@
1-
web1804-php7:
2-
build: .
3-
dockerfile: ./1804/Dockerfile
4-
environment:
5-
- MYSQL_ADMIN_PASS=password
6-
ports:
7-
- "3000:80"
8-
- "3001:3306"
1+
version: "2"
92

10-
web1604-php7:
11-
build: .
12-
dockerfile: ./1604/Dockerfile
13-
environment:
14-
- MYSQL_ADMIN_PASS=password
15-
ports:
16-
- "3010:80"
17-
- "3011:3306"
3+
services:
4+
5+
web1804-php7:
6+
build:
7+
context: .
8+
dockerfile: ./1804/Dockerfile
9+
args:
10+
- PHP_VERSION=7.4
11+
environment:
12+
- MYSQL_ADMIN_PASS=password
13+
ports:
14+
- "3000:80"
15+
- "3001:3306"
16+
tmpfs:
17+
- /var/lib/mysql
18+
19+
web1804-php8:
20+
build:
21+
context: .
22+
dockerfile: ./1804/Dockerfile
23+
args:
24+
- PHP_VERSION=8.0
25+
environment:
26+
- MYSQL_ADMIN_PASS=password
27+
ports:
28+
- "3020:80"
29+
- "3021:3306"
30+
tmpfs:
31+
- /var/lib/mysql
32+
33+
web2004-php7:
34+
build:
35+
context: .
36+
dockerfile: ./2004/Dockerfile
37+
args:
38+
- PHP_VERSION=7.4
39+
environment:
40+
- MYSQL_ADMIN_PASS=password
41+
ports:
42+
- "3030:80"
43+
- "3031:3306"
44+
tmpfs:
45+
- /var/lib/mysql
46+
47+
web2004-php8:
48+
build:
49+
context: .
50+
dockerfile: ./2004/Dockerfile
51+
args:
52+
- PHP_VERSION=8.0
53+
environment:
54+
- MYSQL_ADMIN_PASS=password
55+
ports:
56+
- "3040:80"
57+
- "3041:3306"
58+
tmpfs:
59+
- /var/lib/mysql

0 commit comments

Comments
 (0)