I solved this by writing a startup script that would: - run xvfb - start firefox
By invoking it with the RUN command, xvfb starts when the container starts.
Dockerfile
... ENV DISPLAY :99 ADD run.sh /run.sh RUN chmod a+x /run.sh CMD /run.sh
run.sh
Xvfb :99 -screen 0 640x480x8 -nolisten tcp & firefox
source share