In the general settings, you’ll want to expose the daemon without TLS. This step is necessary so that the daemon listens on a TCP endpoint. If you don’t do this then you won’t be able to connect from WSL.
Last active
January 8, 2019 08:20
-
-
Save salaros/7cc3f768dcfdc58c43585a7232579b59 to your computer and use it in GitHub Desktop.
Make Docker work on Ubuntu WSL (Windows Subsystem for Linux)
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
[automount] | |
root = / | |
options = "metadata" |
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
#!/usr/bin/env bash | |
if [[ ! -f /etc/apt/sources.list.d/docker.list ]]; then | |
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${OS_RELEASE} stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker.list; | |
curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x7EA0A9C3F273FCD8" | sudo apt-key add; | |
fi | |
sudo apt update && sudo apt install docker-compose docker-ce -qy | |
sudo usermod -a -G docker $USER | |
if [ -f ~/.exports ]; then | |
EXPORTS_FILE=~/.exports | |
else | |
EXPORTS_FILE=~/.bashrc | |
fi | |
if [ -z $(grep DOCKER_HOST ${EXPORTS_FILE}) ]; then | |
echo -e "# Use Docker daemon on WSL | |
if grep -q Microsoft /proc/version; then | |
export DOCKER_HOST=tcp://localhost:2375 | |
" >> ${EXPORTS_FILE} && ${EXPORTS_FILE} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment