Last active
June 13, 2016 18:54
-
-
Save kamermans/3b33d1b36c4bf570415c to your computer and use it in GitHub Desktop.
Upgrade Docker and Docker-Compose while deleting all containers and migrating storage
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
#!/bin/sh -e | |
# Upgrade Docker to 1.10 from 1.8+ | |
# curl -sSL https://gist.githubusercontent.com/kamermans/3b33d1b36c4bf570415c/raw/upgrade_docker.sh | sh | |
echo "Upgrading Docker Compose" && sleep 2 | |
COMPOSE=$(which docker-compose || echo /usr/local/bin/docker-compose) | |
curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > $COMPOSE | |
chmod +x $COMPOSE | |
echo "Migrating Docker data to 1.10+ format" && sleep 2 | |
docker run --rm -v /var/lib/docker:/var/lib/docker docker/v1.10-migrator | |
echo "Stopping all containers" && sleep 2 | |
docker stop $(docker ps -q) 2>/dev/null || echo " no running containers" | |
echo "Deleting old containers" && sleep 2 | |
docker rm -vf $(docker ps -qa) 2>/dev/null || echo " no stopped containers" | |
echo "Upgrading Docker Engine" && sleep 2 | |
apt-get install -y docker-engine | |
echo "" | |
docker info | |
docker -v | |
docker-compose -v | |
echo "done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment