Change Docker for Mac Engine /etc files

I have some troubles, with Docker for Mac, because I’m using a Private Trusted Registry in a LAN and we have to configure the ips and hosts in /etc/hosts file.
As far as I know, Docker for Mac doesn’t provide a way to add new files to the Engine easely, and the way I found to do that, doesn’t persist the changes after restarting the Docker App.

Looking to other solutions, I have created a workaround to add attach content to Docker Engine /etc files, create /etc files and add certificates to the Docker Engine.

The idea is to run a container that will make the changes for you, and run it always, even after a Docker Engine restart.
If you want to take a look to the solution just go to this Github repository and feel free to make any suggestion or comments.

1 Like

This worked beautifully for me, thanks a lot for creating this.

1 Like
    screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
    close session:`Ctrl+a d`

   vi /etc/hosts
   service docker restart

The problem of this solution is that the changes are not persisted when you restart Docker Engine.