Last active
December 30, 2016 17:36
-
-
Save blackandred/875b1674e84b4e33acbc3b7f717eba2c to your computer and use it in GitHub Desktop.
Ansible: Recent version of Docker-Compose on Debian/Ubuntu # https://github.com/Wolnosciowiec
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/bash | |
# Installs a recent version of docker-compose | |
# as on recent Ubuntu version it's pretty old | |
# but also this script could help to keep consistency | |
# between developer and production environment | |
# Based on: https://gist.github.com/wdullaer/f1af16bd7e970389bad3 | |
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9]+\.[0-9]+$" | tail -n 1` | |
sudo sh -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 |
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
- name: Install Docker | |
become: yes | |
apt: name={{ item }} state=present | |
with_items: | |
- docker.io | |
- name: Remove docker-compose from package manager | |
become: yes | |
apt: name=docker-compose state=absent | |
- name: Add docker-compose installer | |
become: yes | |
template: src=docker-compose-install.sh dest=/usr/local/bin/docker-compose-install.sh | |
- name: Install recent version of Docker Compose | |
become: yes | |
shell: bash /usr/local/bin/docker-compose-install.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment