Last active
July 13, 2019 18:40
-
-
Save rur0/22555a4f161216ec6270c830831c7d86 to your computer and use it in GitHub Desktop.
docker on ubuntu 18.04 WSL
This file contains 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
# Update the apt package list. | |
sudo apt-get update -y | |
# Install Docker's package dependencies. | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
# Download and add Docker's official public PGP key. | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# Verify the fingerprint. | |
sudo apt-key fingerprint 0EBFCD88 | |
# Add the `stable` channel's Docker upstream repository. | |
# | |
# If you want to live on the edge, you can change "stable" below to "test" or | |
# "nightly". I highly recommend sticking with stable! | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
# Update the apt package list (for the new apt repo). | |
sudo apt-get update -y | |
# Install the latest version of Docker CE. | |
sudo apt-get install -y docker-ce | |
# Allow your user to access the Docker CLI without needing root access. | |
sudo usermod -aG docker $USER | |
############## docker-compose ################ | |
# Install Python and PIP. | |
sudo apt-get install -y python python-pip | |
# Install Docker Compose into your user's home directory. (python version is faster) | |
pip install --user docker-compose | |
# connect to docker daemon (hosted on windows) | |
echo "export DOCKER_HOST=tcp://localhost:2375" >> ~/.bashrc && source ~/.bashrc | |
# You should get a bunch of output about your Docker daemon. | |
# If you get a permission denied error, close + open your terminal and try again. | |
docker info | |
# You should get back your Docker Compose version. | |
docker-compose --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment