Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
# Quick Install for Docker on Debian (LMDE, Mint, Ubuntu, etc)
# Author: Benjamin H. Graham <bman@bman.io>
# 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";
@ivdunin

This comment has been minimized.

Copy link

commented Sep 27, 2016

You should use 'tee -a' in line 22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.