Repository navigation
fix(webserver): replace phar.io/filippo.io links with GitHub releases, improve Dockerfile, for #8012 - #8352
Conversation
|
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. |
|
Download the artifacts for this pull request:
See Testing a PR. |
|
not sure what went wrong. redownloaded the artifact per @stasadev ... this time the correct web container. the first time |
rfay
left a comment
There was a problem hiding this comment.
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 && \ |
| @@ -0,0 +1,29 @@ | |||
| # Configuration file for locale-gen | |||
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Nice reorg.
Do we have adequate test coverage to make sure we don't actually lose one of these by mistake?
There was a problem hiding this comment.
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
|
@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 And you'll get v1.25.2 images. You were getting v1.25.1 images. |
|
@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 |
There was a problem hiding this comment.
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
No need to add Upsun repos twice. TODO: check why tests didn't check for warnings on |
…, 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]>
b9e2b94 to
7d81fb9
Compare
|
Webserver tests are green, pulling. |
|
Wow! |

The Issue
phar.io was intermittently down again, breaking
phiveinstallation in the web container. A secondary issue was thatping host.docker.internaldid not work for users on lima-rootless setups.How This PR Solves The Issue
phar.io / filippo.io → GitHub Releases
phive: replacedhttps://phar.io/releases/phive.pharwith the latest tagged release fromgithub.com/phar-io/phive(viagh_tag()helper).mkcertin dev-base / prod-base: replaceddl.filippo.io/mkcert/latestwith a versioned GitHub release URL.mkcertin Makefile (Windows): same replacement forwindows/amd64andwindows/arm64targets; extracted version into top-levelMKCERT_VERSIONvariable so all targets stay in sync.README.mdanddeveloper-tools.mdupdated fromphar.ioto the GitHub repo.ping fix for lima-rootless (I noticed this in https://gist.github.com/rpkoller/89fa61292fa22f6dc918f2c6dbeb585e#file-output-txt-L672)
setcap cap_net_raw+p /usr/bin/pingso that ping works without root in rootless container runtimes.Dockerfile improvements
ADD→COPYthroughout (best practice;ADDhas implicit tar-extraction and URL-fetch semantics that are not needed here).DEFAULT_LOCALESfrom an inlineARG+printfto a realetc/locale.genfile inddev-webserver-base-files;locale-gennow runs afterCOPY ddev-webserver-base-files /so it picks up the file.BUILDPLATFORMARG and duplicateTARGETPLATFORM/TARGETARCHARGs in prod-base (they are already declared in the base stage and inherited).CAROOTENV from dev-base and prod-base (already set in the base stage).RUNcommands into heredoc blocks withset -eu -o pipefailfor cleaner error propagation and fewer image layers.mkcert,magerun/magerun2, andbackdrop-drush-extensioninstalls fromddev-webserver-dev-baseintoddev-webserver-baseso they are available in production images too; all share a singlegh_tag()helper.mariadb-compat-install.sh+mariadb-skip-ssl-wrapper-install.shinto oneRUN.phpdismodcalls; combineda2dismod/a2enmodcalls; combinedsetcapcalls.jqto the base apt install (needed by the newgh_tag()helper)./var/cache/linux→/var/cache/nginx.apt modernize-sources --assume-yes+ cleanup after Symfony CLI and Platform.sh / Upsun CLI installers to avoid legacy.listfile remnants.Package changes
apt-get install postgresql-commonwithapt-get install --no-install-recommends --no-install-suggests postgresql-commonpostgresql-commonremoved these packages:cron, install it explicitlyqrencode, which we are going to use when adding this add-on to core https://github.com/ddev/ddev-qrManual Testing Instructions
Start a DDEV project using the new image tag and verify:
ddev exec ping host.docker.internalworks (lima-rootless users: this is the change to verify; cc @rpkoller)ddev exec phive --versionreturns a versionddev exec mkcert --versionworksddev exec magerun --versionandddev exec magerun2 --versionworkddev exec locale -a