DigitalOcean, Docker, Dokku: Installing Firefox inside a container

I have an application which needs to use a headed browser periodically.

I want to Host it using Dokku.

  • Symfony 3 assets no update
  • How to set a path on host for a named volume in docker-compose.yml
  • Enter into docker container after shell script execution is complete
  • Best way to use mysql for docker based microservices
  • Facing ISsue while pulling images in Docker
  • Using a volume with a redmine docker container in Bluemix
  • How can I install this into my DO container?

    When I run:

    dokku run MY_APP apt-get install firefox

    I get:
    E: Failed to fetch 404 Not Found [IP: 80]
    E: Failed to fetch 404 Not Found [IP: 80]

    After which running:

    dokku run MY_APP firefox

    FATA[0000] Error response from daemon: Cannot start container … exec: “firefox”: executable file not found in $PATH

    I am aware that PhatomJS is a better solution but some third party gem I am using are dependant on a headed firefox browser.

  • How can I call docker API from container (Docker for Mac)
  • Why do I need to give the hostname in netty socketio and how to handle socketio in docker?
  • How to add $(…):$(…) in Docker Compose
  • How can delay my node-red docker service with docker compose?
  • Docker: Give container user write access to host directory
  • Dockerfile custom commands/directives
  • One Solution collect form web for “DigitalOcean, Docker, Dokku: Installing Firefox inside a container”

    From the error message you are getting when installing Firefox, it seems like your apt cache inside the Docker container is out-of-date. Running apt-get update first should resolve the problem.

    Though to run Firefox headless, you’ll need another step. You’ll need to prepend your command with xvfb-run which is part of the xvfb package. It will allow you to run commands in a virtual X server environment.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.