forked from mitchellh/boot2docker-vagrant-box
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
81 lines (70 loc) · 2.66 KB
/
Makefile
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
all: boot2docker-virtualbox.box boot2docker-parallels.box
virtualbox: boot2docker-virtualbox.box
parallels: boot2docker-parallels.box
boot2docker-virtualbox.box: boot2docker.iso template.json vagrantfile.tpl \
files/bootlocal.sh files/bootsync.sh files/docker-enter files/oem-release
packer build -only virtualbox template.json
boot2docker-parallels.box: boot2docker.iso template.json vagrantfile.tpl \
files/bootlocal.sh files/bootsync.sh files/docker-enter files/oem-release
packer build -only parallels template.json
#boot2docker.iso:
# curl -LO https://github.com/YungSang/boot2docker/releases/download/yungsang%2Fv1.4.1/boot2docker.iso
files/docker-enter:
curl -L https://raw.githubusercontent.com/YungSang/docker-attach/master/docker-nsenter -o files/docker-enter
test: test/Vagrantfile boot2docker-virtualbox.box
@vagrant box add -f boot2docker boot2docker-virtualbox.box
@cd test; \
vagrant destroy -f; \
vagrant up; \
echo "-----> /etc/os-release"; \
vagrant ssh -c "cat /etc/os-release"; \
echo "-----> /etc/oem-release"; \
vagrant ssh -c "cat /etc/oem-release"; \
echo "-----> docker version"; \
DOCKER_HOST="tcp://localhost:2375"; \
docker version; \
echo "-----> docker images -t"; \
docker images -t; \
echo "-----> docker ps -a"; \
docker ps -a; \
echo "-----> nc localhost 8080"; \
nc localhost 8080; \
echo '-----> docker-enter `docker ps -l -q` ls -l'; \
vagrant ssh -c 'docker-enter `docker ps -l -q` ls -l'; \
echo '-----> docker exec `docker ps -l -q` ls -l'; \
docker exec `docker ps -l -q` ls -l; \
vagrant suspend
ptest: DOCKER_HOST_IP=$(shell cd test; vagrant ssh-config | sed -n "s/[ ]*HostName[ ]*//gp")
ptest: ptestup
@cd test; \
echo "-----> /etc/os-release"; \
vagrant ssh -c "cat /etc/os-release"; \
echo "-----> /etc/oem-release"; \
vagrant ssh -c "cat /etc/oem-release"; \
DOCKER_HOST="tcp://${DOCKER_HOST_IP}:2375"; \
echo "-----> docker version"; \
docker version; \
echo "-----> docker images -t"; \
docker images -t; \
echo "-----> docker ps -a"; \
docker ps -a; \
echo "-----> nc ${DOCKER_HOST_IP} 8080"; \
nc ${DOCKER_HOST_IP} 8080; \
echo '-----> docker-enter `docker ps -l -q` ls -l'; \
vagrant ssh -c 'docker-enter `docker ps -l -q` ls -l'; \
echo '-----> docker exec `docker ps -l -q` ls -l'; \
docker exec `docker ps -l -q` ls -l; \
vagrant suspend
ptestup: test/Vagrantfile boot2docker-parallels.box
@vagrant box add -f boot2docker boot2docker-parallels.box
@cd test; \
vagrant destroy -f; \
vagrant up --provider parallels
clean:
cd test; vagrant destroy -f
rm -f boot2docker.iso
rm -f files/docker-enter
rm -f boot2docker-virtualbox.box
rm -f boot2docker-parallels.box
rm -rf output-*/
.PHONY: test clean