11#syntax=docker/dockerfile-upstream:1
22# DO NOT EDIT THIS FILE : Make yours changes in /utils/Dockerfile.*.blueprint)
3- FROM ubuntu:20 .04
3+ FROM ubuntu:24 .04
44LABEL authors="Julien Neuhart <
[email protected] >, David Négrier <
[email protected] >"
55SHELL ["/bin/bash", "-o", "pipefail", "-c"]
66
@@ -31,13 +31,10 @@ ENV PHP_VERSION=${PHP_VERSION}
3131# |
3232
3333# Install php an other packages
34- RUN apt-get update \
35- && apt-get install -y --no-install-recommends gnupg \
36- && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
37- && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
38- && apt-get update \
39- && apt-get upgrade -y \
40- && apt-get install -y --no-install-recommends \
34+ RUN apt update \
35+ && apt install -y software-properties-common \
36+ && add-apt-repository ppa:ondrej/php \
37+ && apt install -y --no-install-recommends \
4138 git \
4239 nano \
4340 sudo \
@@ -54,8 +51,8 @@ RUN apt-get update \
5451 php${PHP_VERSION}-readline \
5552 php${PHP_VERSION}-xml \
5653 php${PHP_VERSION}-zip \
57- && if [[ "${PHP_VERSION}" =~ ^7 ]]; then apt-get install -y --no-install-recommends php${PHP_VERSION}-json; fi \
58- && apt-get clean \
54+ && if [[ "${PHP_VERSION}" =~ ^7 ]]; then apt install -y --no-install-recommends php${PHP_VERSION}-json; fi \
55+ && apt clean \
5956 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
6057
6158# |--------------------------------------------------------------------------
@@ -65,9 +62,10 @@ RUN apt-get update \
6562# | Define a default user with sudo rights.
6663# |
6764
65+ RUN userdel ubuntu && rm -rf /home/ubuntu
6866RUN useradd -ms /bin/bash docker && adduser docker sudo
6967# Users in the sudoers group can sudo as root without password.
70- RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
68+ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/sudo
7169
7270# |--------------------------------------------------------------------------
7371# | Default php.ini file
@@ -156,8 +154,8 @@ ENV APACHE_CONFDIR=/etc/apache2
156154ENV APACHE_ENVVARS=$APACHE_CONFDIR/envvars
157155
158156RUN set -eux; \
159- apt-get update; \
160- apt-get install -y --no-install-recommends apache2 libapache2-mod-php${PHP_VERSION}; \
157+ apt update; \
158+ apt install -y --no-install-recommends apache2 libapache2-mod-php${PHP_VERSION}; \
161159 rm -rf /var/lib/apt/lists/*; \
162160 \
163161# generically convert lines like
@@ -386,22 +384,22 @@ ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \
386384# |
387385ONBUILD ARG NODE_VERSION
388386ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \
389- sudo apt-get update && \
390- sudo apt-get install -y --no-install-recommends gnupg && \
387+ sudo apt update && \
388+ sudo apt install -y --no-install-recommends gnupg && \
391389 if [[ "${NODE_VERSION}" -lt "16" ]]; then \
392390 curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo bash -; \
393391 else \
394392 sudo mkdir -p /etc/apt/keyrings && \
395393 curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
396394 echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list; \
397395 fi && \
398- sudo apt-get update && \
399- sudo apt-get install -y --no-install-recommends nodejs && \
396+ sudo apt update && \
397+ sudo apt install -y --no-install-recommends nodejs && \
400398 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
401399 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
402- sudo apt-get update && \
403- sudo apt-get install -y --no-install-recommends yarn && \
400+ sudo apt update && \
401+ sudo apt install -y --no-install-recommends yarn && \
404402 if [[ "${NODE_VERSION}" == "10" ]]; then sudo npm install -g npm@^6.14; fi && \
405- sudo apt-get clean && \
403+ sudo apt clean && \
406404 sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*; \
407405 fi;
0 commit comments