Split PHP image into php(cli/apache) and yarn(node/nightwatch)

Created on 17 September 2023, over 1 year ago
Updated 10 May 2024, 8 months ago

Problem/Motivation

Currently PHP images has too many layers and unpacked source code (which is useless after intall)

Steps to reproduce

see https://hub.docker.com/r/drupalci/php-8.2-apache/tags

docker history drupalci/php-8.2-apache:dev
IMAGE          CREATED         CREATED BY                                      SIZE      COMMENT
c5a294ce2e7d   2 days ago      /bin/sh -c #(nop)  CMD ["apache2-foreground"]   0B        
<missing>      2 days ago      /bin/sh -c #(nop)  EXPOSE 80                    0B        
<missing>      2 days ago      /bin/sh -c #(nop) WORKDIR /var/www/html         0B        
<missing>      2 days ago      /bin/sh -c #(nop)  ENTRYPOINT ["docker-php-e…   0B        
<missing>      2 days ago      /bin/sh -c curl -sS https://deb.nodesource.c…   193MB     
<missing>      2 days ago      /bin/sh -c apt-get update     && apt-get ins…   1.94MB    
<missing>      2 days ago      /bin/sh -c #(nop) COPY file:a72004d60bd8c098…   374B      
<missing>      2 days ago      /bin/sh -c curl -SL "https://bitbucket.org/a…   79.6MB    
<missing>      2 days ago      /bin/sh -c curl -o /tmp/composer-setup.php h…   7.91MB    
<missing>      2 days ago      /bin/sh -c #(nop) COPY file:db0647a203810f32…   4.32kB    
<missing>      2 days ago      /bin/sh -c #(nop) COPY file:8dfa7a7c5950d30d…   4.32kB    
<missing>      2 days ago      /bin/sh -c docker-php-ext-pecl-install APCu-…   91.5MB    
<missing>      2 days ago      /bin/sh -c #(nop) COPY multi:f3eb57a30eeba02…   6.17kB    
<missing>      2 days ago      /bin/sh -c set -xe  && buildDeps="         a…   657MB     
<missing>      2 days ago      /bin/sh -c #(nop) COPY file:8a5ac966d577d5c8…   601B      
<missing>      2 days ago      /bin/sh -c set -xe;   fetchDeps='   wget  ';…   13.4MB    
<missing>      2 days ago      /bin/sh -c #(nop)  ENV PHP_URL=https://php.n…   0B        
<missing>      2 days ago      /bin/sh -c #(nop)  ENV PHP_VERSION=8.2.10       0B        
<missing>      2 days ago      /bin/sh -c #(nop)  ENV GPG_KEYS=1729F83938DA…   0B        
<missing>      2 days ago      /bin/sh -c #(nop)  ENV PHP_LDFLAGS=             0B        
<missing>      2 days ago      /bin/sh -c #(nop)  ENV PHP_CPPFLAGS=-O2 -g      0B        
<missing>      2 days ago      /bin/sh -c #(nop)  ENV PHP_CFLAGS=-O2 -g        0B        
<missing>      2 days ago      /bin/sh -c mkdir -p /usr/local/etc/php/conf.d   0B        
<missing>      2 days ago      /bin/sh -c apt-get update && apt-get install…   312MB     
<missing>      11 months ago   /bin/sh -c echo "deb http://deb.debian.org/d…   57B       
<missing>      14 months ago   /bin/sh -c a2enmod rewrite     && a2dissite …   60B       
<missing>      14 months ago   /bin/sh -c #(nop) COPY file:bb8f26ae96cdb2cb…   676B      
<missing>      14 months ago   /bin/sh -c #(nop) COPY file:06249e0e634b354e…   440B      
<missing>      14 months ago   /bin/sh -c {   echo '<FilesMatch \.php$>';  …   237B      
<missing>      14 months ago   /bin/sh -c a2dismod mpm_event && a2enmod mpm…   68B       
<missing>      14 months ago   /bin/sh -c set -ex   && sed -ri 's/^export (…   9.92kB    
<missing>      14 months ago   /bin/sh -c apt-get update && apt-get install…   98.7MB    
<missing>      14 months ago   /bin/sh -c #(nop)  ENV TERM=xterm               0B        
<missing>      14 months ago   /bin/sh -c #(nop)  ENV DRUPALCI=TRUE            0B        
<missing>      14 months ago   /bin/sh -c #(nop)  CMD ["bash"]                 0B        
<missing>      14 months ago   /bin/sh -c #(nop) ADD file:3451708ab45bc1bcf…   124MB     

Proposed resolution

Optimize build by
- removing unzipped source
- merging layers where possible to has less changes from https://github.com/docker-library/php/blob/master/8.2/bullseye/apache/Do...

Remaining tasks

review/commit

User interface changes

API changes

Data model changes

📌 Task
Status

Needs review

Component

PHP Containers

Created by

🇫🇷France andypost

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024