Skip to content

fix(webserver): replace phar.io/filippo.io links with GitHub releases, improve Dockerfile, for #8012 - #8352

Merged
stasadev merged 7 commits into
ddev:mainfrom
stasadev:20260427_stasadev_dockerfile
Apr 28, 2026
Merged

stasadev merged 7 commits into
ddev:mainfrom
stasadev:20260427_stasadev_dockerfile

Conversation

@stasadev

@stasadev stasadev commented Apr 27, 2026 •

Copy link
Copy Markdown
Member

The Issue

phar.io was intermittently down again, breaking phive installation in the web container. A secondary issue was that ping host.docker.internal did not work for users on lima-rootless setups.

How This PR Solves The Issue

phar.io / filippo.io → GitHub Releases

  • phive: replaced https://phar.io/releases/phive.phar with the latest tagged release from github.com/phar-io/phive (via gh_tag() helper).
  • mkcert in dev-base / prod-base: replaced dl.filippo.io/mkcert/latest with a versioned GitHub release URL.
  • mkcert in Makefile (Windows): same replacement for windows/amd64 and windows/arm64 targets; extracted version into top-level MKCERT_VERSION variable so all targets stay in sync.
  • PHIVE link in README.md and developer-tools.md updated from phar.io to the GitHub repo.

ping fix for lima-rootless (I noticed this in https://gist.github.com/rpkoller/89fa61292fa22f6dc918f2c6dbeb585e#file-output-txt-L672)

  • Added setcap cap_net_raw+p /usr/bin/ping so that ping works without root in rootless container runtimes.

Dockerfile improvements

  • ADD → COPY throughout (best practice; ADD has implicit tar-extraction and URL-fetch semantics that are not needed here).
  • Moved DEFAULT_LOCALES from an inline ARG + printf to a real etc/locale.gen file in ddev-webserver-base-files; locale-gen now runs after COPY ddev-webserver-base-files / so it picks up the file.
  • Removed unused BUILDPLATFORM ARG and duplicate TARGETPLATFORM/ TARGETARCH ARGs in prod-base (they are already declared in the base stage and inherited).
  • Removed duplicate CAROOT ENV from dev-base and prod-base (already set in the base stage).
  • Consolidated multiple single-line RUN commands into heredoc blocks with set -eu -o pipefail for cleaner error propagation and fewer image layers.
  • Moved mkcert, magerun/magerun2, and backdrop-drush-extension installs from ddev-webserver-dev-base into ddev-webserver-base so they are available in production images too; all share a single gh_tag() helper.
  • Combined mariadb-compat-install.sh + mariadb-skip-ssl-wrapper-install.sh into one RUN.
  • Combined phpdismod calls; combined a2dismod/a2enmod calls; combined setcap calls.
  • Added jq to the base apt install (needed by the new gh_tag() helper).
  • Fixed comment typo: /var/cache/linux → /var/cache/nginx.
  • Used apt modernize-sources --assume-yes + cleanup after Symfony CLI and Platform.sh / Upsun CLI installers to avoid legacy .list file remnants.

Package changes

  • Replaces apt-get install postgresql-common with apt-get install --no-install-recommends --no-install-suggests postgresql-common
  • Removing recommends from postgresql-common removed these packages:
bsd-mailx/now 8.1.2-0.20220412cvs-1.1 amd64 [installed,local]
cron-daemon-common/now 3.0pl1-197 all [installed,local]
cron/now 3.0pl1-197 amd64 [installed,local]
e2fsprogs-l10n/now 1.47.2-3 all [installed,local]
e2fsprogs/now 1.47.2-3+b10 amd64 [installed,local]
exim4-base/now 4.98.2-1 amd64 [installed,local]
exim4-config/now 4.98.2-1 all [installed,local]
exim4-daemon-light/now 4.98.2-1 amd64 [installed,local]
libcommon-sense-perl/now 3.75-3+b5 amd64 [installed,local]
libevent-2.1-7t64/now 2.1.12-stable-10+b1 amd64 [installed,local]
libext2fs2t64/now 1.47.2-3+b10 amd64 [installed,local]
libfile-fcntllock-perl/now 0.22-4+b4 amd64 [installed,local]
libgnutls-dane0t64/now 3.8.9-3+deb13u2 amd64 [installed,local]
libjson-xs-perl/now 4.040-1~deb13u1 amd64 [installed,local]
liblockfile-bin/now 1.17-2 amd64 [installed,local]
liblockfile1/now 1.17-2 amd64 [installed,local]
libnsl2/now 1.3.0-3+b3 amd64 [installed,local]
libss2/now 1.47.2-3+b10 amd64 [installed,local]
libtypes-serialiser-perl/now 1.01-1 all [installed,local]
libunbound8/now 1.22.0-2+deb13u1 amd64 [installed,local]
logrotate/now 3.22.0-1 amd64 [installed,local]
logsave/now 1.47.2-3+b10 amd64 [installed,local]

Manual Testing Instructions

Start a DDEV project using the new image tag and verify:

  • ddev exec ping host.docker.internal works (lima-rootless users: this is the change to verify; cc @rpkoller)
  • ddev exec phive --version returns a version
  • ddev exec mkcert --version works
  • ddev exec magerun --version and ddev exec magerun2 --version work
  • Locales are generated: ddev exec locale -a

@stasadev
stasadev requested review from a team as code owners April 27, 2026 16:04
@github-actions github-actions Bot added bugfix dependencies Pull requests that update a dependency file labels Apr 27, 2026
@stasadev

Copy link
Copy Markdown
Member Author

The changes reduced the ddev-webserver size by about 3 MB (if I did everything correctly): https://hub.docker.com/r/ddev/ddev-webserver/tags

I didn't implement everything I wanted here, but making more changes would make it hard to review.

@github-actions

github-actions Bot commented Apr 27, 2026 •

Copy link
Copy Markdown

@rpkoller

Copy link
Copy Markdown
Collaborator

it was odd. ive downloaded and switched to the artifact from this issue, and on start it triggered the download of every container
Screenshot 2026-04-27 at 18 11 04

i am on

$> ddev version
 ITEM              VALUE                                                 
 DDEV version      v1.25.1-71-g55690e62b                                 
 architecture      arm64                                                 
 cgo_enabled       0                                                     
 db                ddev/ddev-dbserver-mariadb-11.8:v1.25.1               
 ddev-environment  darwin                                                
 ddev-ssh-agent    ddev/ddev-ssh-agent:v1.25.1                           
 docker            29.4.0                                                
 docker-api        1.54                                                  
 docker-buildx     0.33.0                                                
 docker-compose    v5.0.2                                                
 docker-platform   lima-rootless                                         
 global-ddev-dir   /Users/rkoller/.ddev                                  
 go-version        go1.26.2                                              
 mutagen           0.18.1                                                
 os                darwin                                                
 router            ddev/ddev-traefik-router:v1.25.1                      
 web               ddev/ddev-webserver:20260331_stasadev_php85_memcached 
 xhgui-image       ddev/ddev-xhgui:v1.25.1  

and the ping resulted still in the old error:

$> ddev exec ping -c 1 host.docker.internal
ping: socktype: SOCK_RAW
ping: socket: Operation not permitted
ping: => missing cap_net_raw+p capability or setuid?
Failed to execute command `ping -c 1 host.docker.internal`: exit status 2

switching back to my version of HEAD i was coming from i am on

$> ddev version
29.38 MiB / 29.38 MiB [-----------------------------------------------------------------] 100.00% 2.10 MiB p/s 14s
Download complete.
 ITEM              VALUE                                   
 DDEV version      v1.25.2-4-gbd6d75952                    
 architecture      arm64                                   
 cgo_enabled       0                                       
 db                ddev/ddev-dbserver-mariadb-11.8:v1.25.2 
 ddev-environment  darwin                                  
 ddev-ssh-agent    ddev/ddev-ssh-agent:v1.25.2             
 docker            29.4.0                                  
 docker-api        1.54                                    
 docker-buildx     0.33.0                                  
 docker-compose    v5.1.3                                  
 docker-platform   lima-rootless                           
 global-ddev-dir   /Users/rkoller/.ddev                    
 go-version        go1.26.2                                
 mutagen           0.18.1                                  
 os                darwin                                  
 router            ddev/ddev-traefik-router:v1.25.2        
 web               ddev/ddev-webserver:v1.25.2             
 xhgui-image       ddev/ddev-xhgui:v1.25.2   

and again a triggered download

@rpkoller

Copy link
Copy Markdown
Collaborator

not sure what went wrong. redownloaded the artifact per @stasadev ... this time the correct web container. the first time 20260331_stasadev_php85_memcached, this time 20260427_stasadev_dockerfile ... and now also the results look correct and as expected:

$> ddev exec ping -c 1 host.docker.internal
PING host.lima.internal (192.168.5.2) 56(84) bytes of data.
64 bytes from host.lima.internal (192.168.5.2): icmp_seq=1 ttl=254 time=0.244 ms

--- host.lima.internal ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some very nice work here, thanks!

RUN rm -f /etc/apt/sources.list.d/symfony-stable.list && \
printf "Types: deb deb-src\nURIs: https://dl.cloudsmith.io/public/symfony/stable/deb/debian/\nSuites: trixie\nComponents: main\nSigned-By: /usr/share/keyrings/symfony-stable-archive-keyring.gpg\n" > /etc/apt/sources.list.d/symfony-stable.sources
RUN curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | bash && \
apt modernize-sources --assume-yes && \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@@ -0,0 +1,29 @@
# Configuration file for locale-gen

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement to split this out

curl --fail -sSL "https://github.com/FiloSottile/mkcert/releases/download/${tag}/mkcert-${tag}-linux-${TARGETARCH}" --output /usr/local/bin/mkcert
chmod +x /usr/local/bin/mkcert

# Install magerun and magerun2 for Magento

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice reorg.

Do we have adequate test coverage to make sure we don't actually lose one of these by mistake?

@stasadev stasadev Apr 27, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm comparing it manually now:

docker run --rm ddev/ddev-webserver:v1.25.2 apt list --installed
docker run --rm ddev/ddev-webserver:20260427_stasadev_dockerfile apt list --installed

docker run --rm ddev/ddev-webserver:v1.25.2 ls -1 /usr/local/bin
docker run --rm ddev/ddev-webserver:20260427_stasadev_dockerfile ls -1 /usr/local/bin

docker run --rm ddev/ddev-webserver-prod:v1.25.2 apt list --installed
docker run --rm ddev/ddev-webserver-prod:20260427_stasadev_dockerfile apt list --installed

docker run --rm ddev/ddev-webserver-prod:v1.25.2 ls -1 /usr/local/bin
docker run --rm ddev/ddev-webserver-prod:20260427_stasadev_dockerfile ls -1 /usr/local/bin

@rfay

rfay commented Apr 27, 2026

Copy link
Copy Markdown
Member

@rpkoller you seem to have been using wrong version of DDEV, not the one you expected, in #8352 (comment)

When you have the right one you'll see

fay@rfay-hp:~/tmp$ ./ddev version
 ITEM              VALUE
 DDEV version      v1.25.2-5-g5ce4dc91a
 architecture      arm64
 cgo_enabled       0
 db                ddev/ddev-dbserver-mariadb-11.8:v1.25.2
 ddev-environment  wsl2
 ddev-ssh-agent    ddev/ddev-ssh-agent:v1.25.2
 docker            29.4.1
 docker-api        1.54
 docker-buildx     0.33.0
 docker-compose    v5.1.3
 docker-platform   wsl2-docker-ce
 global-ddev-dir   /home/rfay/.ddev
 go-version        go1.26.2
 mutagen           0.18.1
 os                linux
 router            ddev/ddev-traefik-router:v1.25.2
 web               ddev/ddev-webserver:20260427_stasadev_dockerfile
 xhgui-image       ddev/ddev-xhgui:v1.25.2

And you'll get v1.25.2 images. You were getting v1.25.1 images.

@rpkoller

Copy link
Copy Markdown
Collaborator

@rfay i was on the latest version of HEAD and downloaded the artifact right after it got posted on this issue. not sure what went wrong. stas recommended redownloading and switching to the artifact another time. and that time ti worked as you can see in my second comment above.

install -d /usr/share/postgresql-common/pgdg
curl -s -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
apt-get -qq update
apt-get -qq install -y -o Dpkg::Options::="--force-confold" --no-install-recommends --no-install-suggests postgresql-common

@stasadev stasadev Apr 27, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was apt-get install -y postgresql-common, and with --no-install-recommends --no-install-suggests, some packages like cron and logrotate are not installed anymore, that's why -3 MB:

docker run --rm -it ddev/ddev-webserver:v1.25.2 apt-cache rdepends --installed logrotate
logrotate
Reverse Depends:
  cron
  postgresql-common

@stasadev

Copy link
Copy Markdown
Member Author
$ ddev exec sudo apt-get update
Hit:1 http://deb.debian.org/debian trixie InRelease
Hit:2 http://deb.debian.org/debian trixie-updates InRelease                                                                                                                                                                                                 
Hit:3 http://deb.debian.org/debian-security trixie-security InRelease                                                                                                                                                 
Get:4 https://dl.cloudsmith.io/public/symfony/stable/deb/debian trixie InRelease [11.0 kB]                                                                                                                            
Hit:5 https://archive.mariadb.org/mariadb-11.8/repo/debian trixie InRelease                                                                        
Hit:6 https://apt.postgresql.org/pub/repos/apt trixie-pgdg InRelease                                            
Hit:7 https://packages.sury.org/php trixie InRelease                                                            
Hit:8 https://repositories.upsun.com/debian stable InRelease                                                    
Hit:9 http://packages.blackfire.io/debian any InRelease
Fetched 11.0 kB in 1s (14.3 kB/s)
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/upsun.sources:1 and /etc/apt/sources.list.d/upsun.sources:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/upsun.sources:1 and /etc/apt/sources.list.d/upsun.sources:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/upsun.sources:1 and /etc/apt/sources.list.d/upsun.sources:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/upsun.sources:1 and /etc/apt/sources.list.d/upsun.sources:2

$ ddev exec cat /etc/apt/sources.list.d/upsun.sources 
Types: deb
URIs: https://repositories.upsun.com/debian/
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/upsun.asc

Types: deb
URIs: https://repositories.upsun.com/debian/
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/upsun.asc

No need to add Upsun repos twice.

TODO: check why tests didn't check for warnings on apt-get update.

@stasadev
stasadev marked this pull request as draft April 28, 2026 08:50
stasadev and others added 6 commits April 28, 2026 18:46
…, improve Dockerfile

## The Issue

phar.io was intermittently down again, breaking `phive` installation in the
web container. A secondary issue was that `ping host.docker.internal` did not
work for users on lima-rootless setups.

## How This PR Solves The Issue

**phar.io / filippo.io → GitHub Releases**
- `phive`: replaced `https://phar.io/releases/phive.phar` with the latest
  tagged release from `github.com/phar-io/phive` (via `gh_tag()` helper).
- `mkcert` in dev-base / prod-base: replaced `dl.filippo.io/mkcert/latest`
  with a versioned GitHub release URL.
- `mkcert` in Makefile (Windows): same replacement for `windows/amd64` and
  `windows/arm64` targets; extracted version into top-level `MKCERT_VERSION`
  variable so all targets stay in sync.
- PHIVE link in `README.md` and `developer-tools.md` updated from `phar.io`
  to the GitHub repo.

**ping fix for lima-rootless (I noticed this in https://gist.github.com/rpkoller/89fa61292fa22f6dc918f2c6dbeb585e#file-output-txt-L672)**
- Added `setcap cap_net_raw+p /usr/bin/ping so that ping works without root in rootless container runtimes.

**Dockerfile improvements**
- `ADD` → `COPY` throughout (best practice; `ADD` has implicit tar-extraction
  and URL-fetch semantics that are not needed here).
- Moved `DEFAULT_LOCALES` from an inline `ARG` + `printf` to a real
  `etc/locale.gen` file in `ddev-webserver-base-files`; `locale-gen` now
  runs after `COPY ddev-webserver-base-files /` so it picks up the file.
- Removed unused `BUILDPLATFORM` ARG and duplicate `TARGETPLATFORM`/
  `TARGETARCH` ARGs in prod-base (they are already declared in the base
  stage and inherited).
- Removed duplicate `CAROOT` ENV from dev-base and prod-base (already set
  in the base stage).
- Consolidated multiple single-line `RUN` commands into heredoc blocks with
  `set -eu -o pipefail` for cleaner error propagation and fewer image layers.
- Moved `mkcert`, `magerun`/`magerun2`, and `backdrop-drush-extension`
  installs from `ddev-webserver-dev-base` into `ddev-webserver-base` so they
  are available in production images too; all share a single `gh_tag()` helper.
- Combined `mariadb-compat-install.sh` + `mariadb-skip-ssl-wrapper-install.sh`
  into one `RUN`.
- Combined `phpdismod` calls; combined `a2dismod`/`a2enmod` calls; combined
  `setcap` calls.
- Added `jq` to the base apt install (needed by the new `gh_tag()` helper).
- Fixed comment typo: `/var/cache/linux` → `/var/cache/nginx`.
- Used `apt modernize-sources --assume-yes` + cleanup after Symfony CLI and
  Platform.sh / Upsun CLI installers to avoid legacy `.list` file remnants.

## Manual Testing Instructions

Start a DDEV project using the new image tag and verify:
- `ddev exec ping host.docker.internal` works (lima-rootless users: this
  is the change to verify; cc @rpkoller)
- `ddev exec phive --version` returns a version
- `ddev exec mkcert --version` works
- `ddev exec magerun --version` and `ddev exec magerun2 --version` work
- Locales are generated: `ddev exec "locale -a | grep en_US"`

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@stasadev
stasadev force-pushed the 20260427_stasadev_dockerfile branch from b9e2b94 to 7d81fb9 Compare April 28, 2026 15:46
@stasadev
stasadev marked this pull request as ready for review April 28, 2026 15:59
@stasadev

Copy link
Copy Markdown
Member Author

Webserver tests are green, pulling.

@stasadev
stasadev merged commit 50995ce into ddev:main Apr 28, 2026
41 of 47 checks passed
@stasadev
stasadev deleted the 20260427_stasadev_dockerfile branch April 28, 2026 16:19
@rfay

rfay commented Apr 29, 2026

Copy link
Copy Markdown
Member

Wow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants