-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker.install-osx.sh
executable file
·46 lines (40 loc) · 1.25 KB
/
docker.install-osx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
if [ -x /usr/bin/VirtualBox ]
then
if [ -x ~/bin/boot2docker ]
then
echo "boot2Docker installed - skipping"
else
# Enter the installation directory
mkdir -p ~/bin
cd ~/bin
# Get the file
curl https://raw.githubusercontent.com/boot2docker/boot2docker/master/boot2docker > boot2docker
# Mark it executable
chmod +x boot2docker
./boot2docker init
for i in {49000..49900}; do
VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$i,tcp,,$i,,$i";
VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$i,udp,,$i,,$i";
done
./boot2docker up
fi
if [ -x /usr/local/bin/docker ]
then
echo "docker installed - skipping"
else
# -------------- Docker OSX client --------------
DIR=$(mktemp -d ${TMPDIR:-/tmp}/dockerdl.XXXXXXX) && \
curl -f -o $DIR/ld.tgz https://get.docker.io/builds/Darwin/x86_64/docker-latest.tgz && \
gunzip $DIR/ld.tgz && \
tar xvf $DIR/ld.tar -C $DIR/ && \
cp $DIR/usr/local/bin/docker ./docker
# Copy the executable file
sudo mkdir -p /usr/local/bin
sudo cp docker /usr/local/bin/
fi
echo "We are done!. Okthxbye"
else
echo "Please install VirtualBox first"
open https://www.virtualbox.org/wiki/Downloads
fi