Skip to content

Commit 8147644

Browse files
committed
fix: Retry failed apt package downloads when building the PHP images
1 parent aac07be commit 8147644

8 files changed

Lines changed: 32 additions & 0 deletions

File tree

php/php73/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM php:7.3-fpm-bullseye
22

33
ARG TIME_ZONE=Pacific/Auckland
44

5+
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
6+
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
7+
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
8+
59
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
610
apt-transport-https \
711
libgd3 \

php/php74/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM php:7.4-fpm-bullseye
22

33
ARG TIME_ZONE=Pacific/Auckland
44

5+
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
6+
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
7+
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
8+
59
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
610
apt-transport-https \
711
libfreetype6-dev \

php/php80/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM php:8.0-fpm-bullseye
22

33
ARG TIME_ZONE=Pacific/Auckland
44

5+
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
6+
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
7+
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
8+
59
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
610
apt-transport-https \
711
libfreetype6-dev \

php/php81/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM php:8.1-fpm-bookworm
22

33
ARG TIME_ZONE=Pacific/Auckland
44

5+
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
6+
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
7+
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
8+
59
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
610
apt-transport-https \
711
libfreetype6-dev \

php/php82/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM php:8.2-fpm-bookworm
22

33
ARG TIME_ZONE=Pacific/Auckland
44

5+
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
6+
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
7+
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
8+
59
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
610
apt-transport-https \
711
libfreetype6-dev \

php/php83/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM php:8.3-fpm-bookworm
22

33
ARG TIME_ZONE=Pacific/Auckland
44

5+
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
6+
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
7+
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
8+
59
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
610
apt-transport-https \
711
libfreetype6-dev \

php/php84/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM php:8.4-fpm-bookworm
22

33
ARG TIME_ZONE=Pacific/Auckland
44

5+
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
6+
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
7+
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
8+
59
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
610
apt-transport-https \
711
libfreetype6-dev \

php/php85/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ FROM php:8.5.2-fpm-bookworm
22

33
ARG TIME_ZONE=Pacific/Auckland
44

5+
# apt does not retry failed downloads, so a single timed out .deb from the Debian CDN fails
6+
# the whole build. Older suites go cold in the CDN more often, but any suite can time out.
7+
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries
8+
59
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
610
apt-transport-https \
711
libfreetype6-dev \

0 commit comments

Comments
 (0)