How to install a package through snap inside a Docker container?

In the Dockerfile I’m trying to install firefox into the image. Since there is no normal package available any more in Ubuntu 22.04 I try to call snap install firefox that gives the following error:

error: cannot communicate with server: Post "http://localhost/v2/snaps/firefox": dial unix /run/snapd.socket: connect: no such file or directory

How to install snaps into a Docker image?