In this technical post I will explain how I resolved one of my previous issues, running chrome browser in headless in docker.
It seems that if you want to run various docker machines without strange issues, you have to install it on some of supported Linux platforms. For now, Mac and Windows platform are using VirtualBox images that can cause you a lot of headache.
You can go in two directions, create generic docker machine from your Mac (or Windows) on Linux. Or install docker-compose on Linux and do everything from that Linux shell.
I recommend later approach, and here is why.
Create generic docker machine option
You need to prepare Linux user on host machine with following configuration:
- user has to be sudoer with no password option
- ssh with no password authentication
- ssh with public key
- port 2376 and 22 opened on firewall
How did I found out those requirements that are not documented? Use docker-machine –debug option.
Why I do not recommend that approach? Because you will be able to communicate with that docker machine only from machine that created it. There are number of explanations how to connect to same docker-machine from two different computers, but none of those approaches worked for me.
Create containers from Linux terminal
I recommend that approach because you will be able to ssh to docker host machine from different computers using ssh.
And remember about my problem running chrome in headless mode in docker container in VirtualBox? On docker installed on Linux they are not present!