Sign inSign up

aleemont/firefox-container

By aleemont

•Updated over 2 years ago

Ready-to-run firefox image, with hw acceleration (AMD), audio (pipewire) and smooth scrolling.

Image
Developer tools
Operating systems
0

914

aleemont/firefox-container repository overview

⁠Firefox

⁠Usage

This is a firefox docker image. It's based on Alpine linux, it has support for audio (needs pipewire on the host machine), smooth scrolling and hw acceleration (AMD gpus only).
Run with:

docker run --name firefox --rm -e DISPLAY=$DISPLAY --net=host -v /run/user/$(id -u)/pipewire-0:/tmp/pipewire-0 -v /dev/dri:/dev/dri aleemont/firefox-container 
⁠Options

To disable hw acceleration do not mount /dev/dri:/dev/dri volume.
To disable audio (or if you are not using pipewire) do not mount the /run/user/$(id -u)/pipewire-0:/tmp/pipewire-0 volume.

⁠Troubleshooting

⁠Can't open display

If you see this error:

Authorization required, but no authorization protocol specified

Error: cannot open display: :1

You need to run xhost +local:docker in order to let the the docker containers access your X-server.

⁠Utilities

⁠Launch script

You can create a script to avoid mounting the volumes everytime by hand:

echo "#\!/bin/bash\ndocker run --rm --net=host -v /run/user/$(id -u)/pipewire-0:/tmp/pipewire-0 -v /dev/dri:/dev/dri aleemont/firefox-container" > /usr/bin/firefox-container 

Then launch the firefox application with:

firefox-container

NOTE: You can also replace /usr/bin/firefox with that script in order to always launch the containerized firefox.

⁠Saving changes

If you wish to modify options inside Firefox (e.g. signing in for the first time, or modifying firefox settings) you'll need to remove the --rm flag from the running command, perform the changes you need (e.g. sign in your Mozilla account and sync settings), exit the container and issue the following command:

docker commit -m "Update settings" -a "your_nickname" firefox your_repo/firefox-container && docker rm firefox 

Now you can either:

  • Continue using the local version of the container (with the updated settings) by running:
docker run --name firefox --rm -e DISPLAY=$DISPLAY --net=host -v /run/user/$(id -u)/pipewire-0:/tmp/pipewire-0 -v /dev/dri:/dev/dri your_repo/firefox-container 
  • Push your new image to a new repository (WARNING: If you save your passwords or accounts EVERYBODY with access to your image will have access to your account, I DO NOT recommend doing this in a public repository, please create a PRIVATE repository or host your own repositories in a safe location if you want to save your accounts, passwords or personal information in the image)
docker push your_private_and_secure_repo/firefox-container

Tag summary

Content type

Image

Digest

sha256:ce7c6ec41…

Size

429.5 MB

Last updated

over 2 years ago

docker pull aleemont/firefox-container