We used to install Firefox via apt-get install firefox in Ubuntu Docker images. However, starting from Ubuntu 22.04, the Firefox installed via this approach cannot be launched in the Docker container.
1 2 3 4 5
$ firefox Command '/usr/bin/firefox' requires the firefox snap to be installed. Please install it with:
snap install firefox
It seems that we would have to install Firefox via snap instead of apt-get in Ubuntu 22.04 and later. However, it is not quite possible to install snap in Docker images due to the lack of systemd in the Docker container.
In this blog post, I would like to quickly show how to install Firefox in Ubuntu 24.04 Docker images.
Firefox Installation In Ubuntu 24.04 Docker
The Dockerfile for Firefox installation in Ubuntu 22.04 or 24.04 can be configured as follows.