Skip to content

Instantly share code, notes, and snippets.

@rachidbch
Last active March 24, 2021 14:34
Show Gist options
  • Save rachidbch/2c947cf92fdd15f6a2b4eddbf6baeb1a to your computer and use it in GitHub Desktop.
Save rachidbch/2c947cf92fdd15f6a2b4eddbf6baeb1a to your computer and use it in GitHub Desktop.
Docker & Docker-Compose Install Script
curl -fsSL https://get.docker.com | sh
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo usermod -aG docker $USER
newgrp docker
newgrp $USER
# Sometimes, when Docker is installed by root, but launched by user in docker group,
# Docker fails with a cryptic message about map segment error shared library libz.so.1
# This is due to Docker trying to access root's tmp folder without permission
# This teaches Docker where to look for tmp folder
echo "export TMPDIR=$HOME/tmp" >> ~/.bashrc
# Then verify Install with:
# $ docker run hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment