Skip to content

Commit

Permalink
refactor: install limited locales by default, provide configuration f…
Browse files Browse the repository at this point in the history
…or additional locales, for ddev#5984 (ddev#6570)

Co-authored-by: Randy Fay <[email protected]>
Co-authored-by: Stanislav Zhuk <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent 45c6567 commit 3e8ddfc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 4 additions & 3 deletions containers/ddev-webserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ENV CAROOT=/mnt/ddev-global-cache/mkcert
# BUILDPLATFORM is the platform of the build host (e.g. linux/amd64)
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG DEFAULT_LOCALES="en_CA.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nen_GB.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8\nde_AT.UTF-8 UTF-8\nfr_CA.UTF-8 UTF-8\nfr_FR.UTF-8 UTF-8\nja_JP.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8\n"

ADD ddev-webserver-etc-skel /
RUN /sbin/mkhomedir_helper www-data
Expand All @@ -38,14 +39,16 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install -y -o Dpkg::Options::="--
bash-completion \
libcap2-bin \
libmagickcore-6.q16-6-extra \
locales-all \
locales \
mariadb-client \
postgresql-client \
pv \
supervisor \
symfony-cli \
xz-utils

RUN printf "${DEFAULT_LOCALES}" > /etc/locale.gen && locale-gen

# Arbitrary user needs to be able to bind to privileged ports (for nginx and apache2)
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/sbin/nginx
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/sbin/apache2
Expand Down Expand Up @@ -102,7 +105,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install -o Dpkg::Options::="--for
libpcre3 \
libpq-dev \
libpython3-dev \
locales-all \
nano \
ncurses-bin \
netcat-traditional \
Expand Down Expand Up @@ -248,7 +250,6 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install -o Dpkg::Options::="--for
iputils-ping \
jq \
libpcre3 \
locales-all \
nano \
ncurses-bin \
netcat-traditional \
Expand Down
11 changes: 11 additions & 0 deletions docs/content/users/extend/customizing-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ RUN chmod 666 /etc/php/${DDEV_PHP_VERSION}/mods-available/xdebug.ini
#RUN phpenmod ${extension}
```

## Adding Locales

The web image ships by default with a small number of locales, which work for most usages, including
`en_CA`, `en_US`, `en_GB`, `de_DE`, `de_AT`, `fr_CA`, `fr_FR`, `ja_JP`, and `ru_RU`.

If you need other locales, you can install all of them by adding `locales-all` to your `webimage_extra_packages`. For example, in `.ddev/config.yaml`:

```
webimage_extra_packages: [locales-all]
```

## Adding Extra Dockerfiles for `webimage` and `dbimage`

For more complex requirements, you can add:
Expand Down
2 changes: 1 addition & 1 deletion pkg/versionconstants/versionconstants.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var AmplitudeAPIKey = ""
var WebImg = "ddev/ddev-webserver"

// WebTag defines the default web image tag
var WebTag = "v1.23.5" // Note that this can be overridden by make
var WebTag = "20241006_deviantintegral_us_locale" // Note that this can be overridden by make

// DBImg defines the default db image used for applications.
var DBImg = "ddev/ddev-dbserver"
Expand Down

0 comments on commit 3e8ddfc

Please sign in to comment.