Created
December 31, 2014 02:01
-
-
Save bhgraham/ed9f8242dc610b1f38e5 to your computer and use it in GitHub Desktop.
Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
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
# Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc) | |
# Author: Benjamin H. Graham <[email protected]> | |
# Usage: curl -s bman.io/i/install_dockerdeb | bash | |
# Add debian repo | |
echo "Adding the debian repository for docker" | |
echo deb http://get.docker.io/ubuntu docker main | sudo tee /etc/apt/sources.list.d/docker.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
echo "Updating apt repos" | |
sudo apt-get update -qq | |
echo "Installing docker" | |
sudo apt-get install -y lxc-docker | |
echo "Enabling current user to use docker" | |
sudo groupadd docker | |
# Add the connected user "${USER}" to the docker group. | |
# Change the user name to match your preferred user. | |
# You may have to logout and log back in again for | |
# this to take effect. | |
sudo gpasswd -a ${USER} docker | |
echo 'DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"'| sudo tee /etc/default/docker | |
echo "export DOCKER_HOST=tcp://127.0.0.1:2375" | sudo tee /etc/profile; | |
# Restart the Docker daemon. | |
echo "Restarting docker daemon" | |
sudo service docker restart | |
echo "Testing docker with hello-world"; | |
export DOCKER_HOST=tcp://127.0.0.1:2375; | |
docker -H tcp://127.0.0.1:2375 run hello-world; | |
echo "You should see a hello world message above."; | |
echo "You will need to logout and back in to use docker. Otherwise run this: "; | |
echo "DOCKER_HOST=tcp://127.0.0.1:2375"; | |
echo "Or you can test again with this: "; | |
echo "docker -H tcp://127.0.0.1:2375 run hello-world"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should use 'tee -a' in line 22.