Skip to content

Instantly share code, notes, and snippets.

View guizsantos's full-sized avatar

Guilherme Zanotelli guizsantos

View GitHub Profile
@guizsantos
guizsantos / setup_docker.sh
Last active May 2, 2023 18:26
Install Docker in Windows 10/11 without Docker Desktop (WSL 2)
# 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