I am experiencing issues when I try to build some containers. The containers that I try to build are not fancy or anything.
I am on a Mac, I am using Tahoe. The Dockerfile is using php:8.5-apache-trixie, and it fails when I run the command apt install with 27 packages, which is a huge amount of packages, I admit. When installing them, I have the following error:
Error: You don’t have enough free space in /var/cache/apt/archives/
On my mac, I have no disk space issue, the filesystem state look like this:
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk3s3s1 460Gi 17Gi 133Gi 12% 426k 1,4G 0% /
devfs 198Ki 198Ki 0Bi 100% 686 0 100% /dev
/dev/disk3s6 460Gi 20Ki 133Gi 1% 0 1,4G 0% /System/Volumes/VM
/dev/disk3s4 460Gi 15Gi 133Gi 11% 2,1k 1,4G 0% /System/Volumes/Preboot
/dev/disk3s2 460Gi 813Mi 133Gi 1% 316 1,4G 0% /System/Volumes/Update
/dev/disk1s2 500Mi 6,0Mi 481Mi 2% 1 4,9M 0% /System/Volumes/xarts
/dev/disk1s1 500Mi 5,4Mi 481Mi 2% 39 4,9M 0% /System/Volumes/iSCPreboot
/dev/disk1s3 500Mi 2,5Mi 481Mi 1% 53 4,9M 0% /System/Volumes/Hardware
/dev/disk3s1 460Gi 292Gi 133Gi 69% 2,1M 1,4G 0% /System/Volumes/Data
map auto_home 0Bi 0Bi 0Bi 100% 0 0 - /System/Volumes/Data/home
/dev/disk3s3 460Gi 17Gi 133Gi 12% 459k 1,4G 0% /System/Volumes/Update/mnt1
The docker system df show the following values:
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 3 3 7.046GB 0B (0%)
Containers 3 3 13.19MB 0B (0%)
Local Volumes 0 0 0B 0B
Build Cache 40 0 1.479GB 1.479GB
When I check the builders disk usage, it doesn’t looks this big, the docker buildx du command says I have 391.2MB used. I’ve read the apt.conf documentation, no cache limitation is set. So I can’t identify the issue’s source. I am looking for help.
I have already tried using docker system prune -a and restarting my Mac, this doesn’t change anything.
I have tried splitting my install file into 3 separate files, and doing apt install && apt clean to try clearing the cache, this did not change anything.
My Dockerfile is as follow:
# set build args
ARG PHP_VERSION=8.5
ARG WEB_DIR="/var/www/project"
# Configure webserver
FROM php:${PHP_VERSION}-apache-trixie
ARG WEB_DIR
## Copy configs
COPY configs/Php configs/System configs/Apache /tmpcopy/
WORKDIR ${WEB_DIR}
USER root
RUN mkdir -p /var/www/apache2 && chown -R www-data:www-data /var/www/apache2
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
# Set env
ENV APACHE_RUN_SERVER=www-data \
APACHE_RUN_GROUP=www-data \
APACHE_RUN_USER=www-data \
[APACHE_SRV_ADMIN=hotlinesi@rhinos.fr](mailto:APACHE_SRV_ADMIN=hotlinesi@rhinos.fr) \
SERVER_NAME=rs_apache_php8 \
APACHE_LOG_DIR=/var/www//apache2 \
APACHE_LOCK_DIR=/var/www/apache2 \
APACHE_PID_FILE=/var/www/apache2/apache2.pid\
APACHE_RUN_DIR=/var/www/apache2 \
WEB_DIR=/var/www/project \
APACHE_DOC_ROOT=/var/www/project/public
## Config
USER root
RUN apt update -y && apt upgrade -y && xargs -a /tmpcopy/apt-system-packages.txt apt install -y --no-install-recommends \
&& xargs -a /tmpcopy/install-tools.txt apt install -y --no-install-recommends \
&& xargs -a /tmpcopy/php-extensions.txt install-php-extensions \
&& mv /tmpcopy/php.ini-dev "$PHP_INI_DIR"/php.ini-development \
&& mv /tmpcopy/php.ini-prod "$PHP_INI_DIR"/php.ini-production \
&& echo "ServerName ${SERVER_NAME}" >> /etc/apache2/apache2.conf \
&& sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/ports.conf \
&& mv /tmpcopy/default_vhost.conf /etc/apache2/sites-available/000-default.conf \
&& mv /tmpcopy/httpd-secure.conf /etc/apache2/conf-available/httpd-secure.conf \
&& ln -svf /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf \
&& mv /tmpcopy/locales.txt /etc/locale.gen && locale-gen \
&& ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata \
&& a2enmod rewrite \
&& a2enmod headers \
&& mkdir -p /var/www/.ssh \
&& chmod 0700 /var/www/.ssh \
&& ssh-keyscan [github.com](http://github.com/) > /var/www/.ssh/known_hosts \
&& chown -R www-data:www-data /var/www \
&& mkdir -p ${WEB_DIR} \
&& chown www-data:www-data ${WEB_DIR} && chmod 760 ${WEB_DIR} \
&& git config --global --add [safe.directory](http://safe.directory/) ${WEB_DIR} \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php --install-dir=/usr/bin/ --filename=composer \
&& rm composer-setup.php \
&& xargs -a /tmpcopy/install-tools.txt apt remove -y --purge \
&& apt autoremove -y && apt autoclean -y && apt clean \
&& rm -rf /tmpcopy \
&& mkdir -p /var/www/.composer && chown -R www-data /var/www/.composer
## Run apache
CMD [ "bash", "-c", "apache2-foreground" ]
# chg user
USER www-data:www-data
This is the list of package I am installing:
openssh-client
locales
curl
lsof
default-mysql-client
tar
zlib1g-dev
libpng-dev
libzip-dev
libjpeg62-turbo
libxrender1
libmagickwand-dev
xfonts-base
xfonts-75dpi
ca-certificates
xauth
xvfb
fontconfig
dos2unix
jq
git
unzip
pkg-config
libcurl4-openssl-dev
libicu-dev
zlib1g-dev
In Docker Desktop > Settings > Ressources, I did set a 60G limit, in Settings > Builders, i did set a 20G limit to my default builder. The builder settings show that I have 1.4G used on 20G.