Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Docker Engine & Docker Compose in Ubuntu 18 LTS - wget -O - https://bit.ly/2YAnUp8 | bash
#!/usr/bin/env bash
#DOCKER_VERSION=18.06.1~ce~3-0~ubuntu
COMPOSE_VERSION=1.23.2
# TOOLS
sudo apt-get -y install curl wget make jq git make tree htop conntrack bash-completion build-essential python-pip python-virtualenv rsync unzip apache2-utils
# DOCKER ENGINE
sudo groupadd -f docker
sudo usermod -aG docker $(whoami)
sudo apt-get -y remove docker docker-engine docker.io
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
# sudo apt-cache madison docker-ce | awk '{print $3}'
# or sudo apt-cache policy docker-ce
sudo apt-get -y install docker-ce
#sudo apt-get -y install docker-ce=$DOCKER_VERSION
sudo systemctl enable docker
sudo systemctl start docker
# echo manual | sudo tee /etc/init/docker.override
# sudo update-rc.d docker defaults
# DOCKER COMPOSE
sudo bash -c "curl -L https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
sudo bash -c "curl -L https://raw.githubusercontent.com/docker/compose/$COMPOSE_VERSION/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose"
@nhooey

This comment has been minimized.

Copy link

nhooey commented Sep 12, 2019

Installing the latest version of Docker Compose can be done using Pip3:

$ sudo apt-get install python3-pip
$ sudo pip3 install docker-compose

$ docker-compose --version
docker-compose version 1.24.1, build 4667896
@nhooey

This comment has been minimized.

Copy link

nhooey commented Sep 12, 2019

And then install this so docker login will actually work:

sudo apt-get install gnupg2 pass

Without it, you will likely get this error:

Error saving credentials: error storing credentials - err: exit status 1, out: `Cannot autolaunch D-Bus without X11 $DISPLAY`
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.