This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Follow the Docker official instructions to install the engine, CLI and other utilities | |
| # https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository | |
| # PS: the `docker run hello-world` will not work, follow the next steps to get it working | |
| # In you startup script (bashrc, zshrc, or similar) add the following lines | |
| export DOCKER_HOST=$(ifconfig eth0 | grep -Po "(?<=inet )\d+\.\d+\.\d+\.\d+") | |
| if [ -z "$(ps aux | grep dockerd | grep -v grep)" ]; then | |
| echo "Starting docker daemon on host $DOCKER_HOST" | |
| sudo dockerd -H $DOCKER_HOST >>~/.logs/dockerd/out 2>>~/.logs/dockerd/err & | |
| disown |