Reorder commands to use docker cache more effectively

master
Carlos Gomes 2024-06-17 22:39:20 +02:00
rodzic d41e0633fd
commit e59cf17d49
Nie znaleziono w bazie danych klucza dla tego podpisu
1 zmienionych plików z 41 dodań i 39 usunięć

Wyświetl plik

@ -34,44 +34,6 @@ RUN \
&& rm -rf /var/cache/apt/*
ARG PHP_VERSION=8.2
RUN \
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
php-pear \
php${PHP_VERSION}-bcmath \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-common \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-sqlite3 \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-zip \
&& apt-get autoremove -y --purge \
&& apt-get autoclean -y \
&& apt-get clean -y \
&& rm -rf /var/cache/debconf/*-old \
&& rm -rf /usr/share/doc/* \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/*
# https://getcomposer.org/download/
# latest-stable will be replaced by a version number for PHP 7.1
ARG COMPOSER_VERSION="latest-stable"
ADD --chmod=755 \
https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar \
/usr/local/bin/composer
# ARG DEPLOYER_VERSION="v6.9.0"
# RUN \
# curl -L "https://deployer.org/releases/${DEPLOYER_VERSION}/deployer.phar" \
# --output /usr/local/bin/dep \
# && chmod +x /usr/local/bin/dep
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
# ARG TARGETARCH
@ -103,7 +65,6 @@ RUN \
| tee /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y nodejs \
&& npm i -g yarn pnpm@8 \
&& apt-get autoremove -y --purge \
&& apt-get autoclean -y \
&& apt-get clean -y \
@ -112,6 +73,47 @@ RUN \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/*
ARG PHP_VERSION=8.2
RUN \
LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
php-pear \
php${PHP_VERSION}-bcmath \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-common \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-sqlite3 \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-zip \
&& apt-get autoremove -y --purge \
&& apt-get autoclean -y \
&& apt-get clean -y \
&& rm -rf /var/cache/debconf/*-old \
&& rm -rf /usr/share/doc/* \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/apt/*
RUN npm i -g yarn pnpm@8
# https://getcomposer.org/download/
# latest-stable will be replaced by a version number for PHP 7.1
ARG COMPOSER_VERSION="latest-stable"
ADD --chmod=755 \
https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar \
/usr/local/bin/composer
ARG DEPLOYER_VERSION="v6.9.0"
RUN \
curl -L "https://deployer.org/releases/${DEPLOYER_VERSION}/deployer.phar" \
--output /usr/local/bin/dep \
&& chmod +x /usr/local/bin/dep
COPY zshrc /root/.zshrc
ENTRYPOINT ["/usr/bin/tini", "--"]