accetto / ubuntu-vnc-xfce-g3

Headless Ubuntu/Xfce containers with VNC/noVNC (G3v6).
MIT License
223 stars 63 forks source link

is it possiable to adding locales #44

Closed dandelions closed 1 year ago

dandelions commented 1 year ago

It's a great Desktop docker image,But i want to use another language, it's hard to install locales. So is it possiable add locales in this image. Thanks very much

accetto commented 1 year ago

Hello @dandelions ,

you can install locales in the running container, but the changes would not be persistent.

The better way is to extend my image and to build your own. You can add also more features on the way.

For example, for the Dutch locale you can start with the Dockerfile like this:

FROM accetto/ubuntu-vnc-xfce-g3:latest

USER 0

RUN \
    apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        locales \
    && sed -i -e 's/# nl_NL ISO-8859-1/nl_NL ISO-8859-1/' /etc/locale.gen \
    && sed -i -e 's/# nl_NL.UTF-8 UTF-8/nl_NL.UTF-8 UTF-8/' /etc/locale.gen \
    && sed -i -e 's/# nl_NL@euro ISO-8859-15/nl_NL@euro ISO-8859-15/' /etc/locale.gen \
    && locale-gen \
    && apt-get -y autoremove \
    && rm -rf /var/lib/apt/lists/*

ENV \
    LANGUAGE=nl_NL \
    LANG=nl_NL \
    LC_ALL=nl_NL

USER "${HEADLESS_USER_ID}"

You can buil a new image like this:

docker build -f Dockerfile -t my/image

Then you can check it in the running container like tjis:

$ locale
LANG=nl_NL
LANGUAGE=nl_NL
LC_CTYPE="nl_NL"
LC_NUMERIC="nl_NL"
LC_TIME="nl_NL"
LC_COLLATE="nl_NL"
LC_MONETARY="nl_NL"
LC_MESSAGES="nl_NL"
LC_PAPER="nl_NL"
LC_NAME="nl_NL"
LC_ADDRESS="nl_NL"
LC_TELEPHONE="nl_NL"
LC_MEASUREMENT="nl_NL"
LC_IDENTIFICATION="nl_NL"
LC_ALL=nl_NL

Regards, accetto

accetto commented 1 year ago

Closing because of no further communication from @dandelions.