Update firefox image

- Add example usage in such a way that `DIR=firefox make run` work
- Use bullseye (stable) instead of sid (unstable) as base-image
- Make it possible to change this at buildtime with the buildarg DEBVERSION
- Take firefox from bionic (newest LTS) instead of xenial (older LTS)
- Make it possible to change this at buildtime with the buildarg UBUVERSION
- Use UTF-8 as default LANG
- Run it as user "user" with homedir "/home/user"
- Make it possible to change this at buildtime with the buildargs USER and HOME
This commit is contained in:
Nikolas Garofil 2020-03-29 21:25:53 +02:00
parent a20a544be1
commit 4224f748b7

View File

@ -1,12 +1,24 @@
FROM debian:sid-slim #Run firefox in a container:
#
#docker run -d --rm --net host \
# --device /dev/snd --device /dev/dri -v /dev/shm:/dev/shm \
# -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY \
# -v $HOME/Downloads:/home/user/Downloads \
# -v $HOME/.mozilla:/home/user/.mozilla \
# --name firefox jess/firefox
#
ARG DEBVERSION=bullseye-slim
FROM debian:$DEBVERSION
LABEL maintainer "Jessie Frazelle <jess@linux.com>" LABEL maintainer "Jessie Frazelle <jess@linux.com>"
ARG UBUVERSION=bionic
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
dirmngr \ dirmngr \
gnupg \ gnupg \
--no-install-recommends \ --no-install-recommends \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0AB215679C571D1C8325275B9BDB3D89CE49EC21 \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0AB215679C571D1C8325275B9BDB3D89CE49EC21 \
&& echo "deb http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu xenial main" >> /etc/apt/sources.list.d/firefox.list \ && echo "deb http://ppa.launchpad.net/mozillateam/firefox-next/ubuntu ${UBUVERSION} main" >> /etc/apt/sources.list.d/firefox.list \
&& apt-get update && apt-get install -y \ && apt-get update && apt-get install -y \
apulse \ apulse \
ca-certificates \ ca-certificates \
@ -23,7 +35,7 @@ RUN apt-get update && apt-get install -y \
--no-install-recommends \ --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
ENV LANG en-US ENV LANG C.UTF-8
COPY local.conf /etc/fonts/local.conf COPY local.conf /etc/fonts/local.conf
@ -31,4 +43,10 @@ RUN echo 'pref("browser.tabs.remote.autostart", false);' >> /etc/firefox/syspref
COPY entrypoint.sh /usr/bin/startfirefox COPY entrypoint.sh /usr/bin/startfirefox
ARG USER=user
ARG HOME=/home/${USER}
RUN useradd --create-home --home-dir $HOME $USER && chown -R ${USER}:${USER} $HOME
WORKDIR $HOME
USER $USER
ENTRYPOINT [ "startfirefox" ] ENTRYPOINT [ "startfirefox" ]