Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | UBUNTU:=$(shell which apt > /dev/null 2>&1; echo $$?) |
| 2 | |
| 3 | ifeq ($(UBUNTU),0) |
| 4 | |
| 5 | # ******************* apt-based distros *************************** |
| 6 | prereqs: /usr/bin/http docker /usr/bin/curl /usr/local/bin/docker-compose |
| 7 | |
| 8 | /usr/bin/http: |
| 9 | sudo apt-get -y install httpie |
| 10 | |
| 11 | /usr/bin/curl: |
| 12 | sudo apt-get -y install curl |
| 13 | |
| 14 | docker: |
| 15 | which docker > /dev/null || wget -qO- https://get.docker.com/ | sh |
| 16 | sudo usermod -aG docker $(shell whoami) |
| 17 | |
| 18 | else |
| 19 | |
| 20 | # ****************** RPM-based distros ****************** |
| 21 | |
| 22 | # (untested / work-in-progress) |
| 23 | |
| 24 | prereqs: /usr/bin/pip /usr/bin/http docker /usr/local/bin/docker-compose |
| 25 | |
| 26 | /usr/bin/pip: |
| 27 | curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" |
| 28 | sudo python ./get-pip.py |
| 29 | |
| 30 | docker: |
| 31 | which docker > /dev/null || wget -qO- https://get.docker.com/ | sh |
| 32 | sudo usermod -aG docker $(shell whoami) |
| 33 | |
| 34 | /usr/bin/http: |
| 35 | sudo pip install httpie |
| 36 | |
| 37 | endif |
| 38 | |
| 39 | /usr/local/bin/docker-compose: |
| 40 | sudo bash -c "curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose" |
| 41 | sudo chmod +x /usr/local/bin/docker-compose |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 42 | |
| 43 | rebuild_docker: |
| 44 | stat docker_build || git clone https://github.com/dotcloud/docker.git docker_build |
| 45 | sudo make -C docker_build build |
| 46 | sudo make -C docker_build binary |
| 47 | sudo service docker stop |
| 48 | sudo mv /usr/bin/docker /usr/bin/docker-old |
| 49 | sudo cp docker_build/bundles/latest/binary-client/docker /usr/bin/ |
| 50 | sudo cp docker_build/bundles/latest/binary-daemon/dockerd /usr/bin/ |
| 51 | sudo cp docker_build/bundles/latest/binary-daemon/docker-containerd /usr/bin/ |
| 52 | sudo cp docker_build/bundles/latest/binary-daemon/docker-containerd-shim /usr/bin/ |
| 53 | sudo cp docker_build/bundles/latest/binary-daemon/docker-containerd-ctr /usr/bin/ |
| 54 | sudo cp docker_build/bundles/latest/binary-daemon/docker-runc /usr/bin/ |
| 55 | sudo service docker start |