This repository was archived by the owner on Feb 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +169
-19
lines changed Expand file tree Collapse file tree 10 files changed +169
-19
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ $ wget -qO- https://hyper.sh/install | bash
15
15
16
16
## install hypercontainer
17
17
18
- website: http ://hypercontainer.io
18
+ website: https ://hypercontainer.io
19
19
20
20
```
21
- $ curl -sSL http ://hypercontainer.io/install | bash
21
+ $ curl -sSL https ://hypercontainer.io/install | bash
22
22
or
23
- $ wget -qO- http ://hypercontainer.io/install | bash
23
+ $ wget -qO- https ://hypercontainer.io/install | bash
24
24
```
Original file line number Diff line number Diff line change
1
+ Test hyper install script in docker container
2
+ =============================================
3
+
4
+ ## Dependency
5
+
6
+ - qemu 2+
7
+ - libvirt
8
+
9
+ ## Usage
10
+
11
+ > example
12
+
13
+ ```
14
+ cd centos
15
+
16
+ //build image hyperhq/test-installer-centos:7.2.1511
17
+ ./util.sh build
18
+
19
+ //run container test-installer-centos
20
+ ./util.sh run
21
+
22
+ //install hypercli in container
23
+ ./util.sh test_hyper
24
+
25
+ //install hypercontainer in container
26
+ ./util.sh test_hypercontainer
27
+ ```
Original file line number Diff line number Diff line change 1
1
FROM centos:7.2.1511
2
2
MAINTAINER Jimmy Xu <
[email protected] >
3
3
4
- RUN yum install -y qemu-kvm wget vim && yum clean all
4
+ RUN yum install -y qemu-kvm \
5
+ wget curl git vim ca-certificates \
6
+ && yum clean all
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ function run() {
32
32
fi
33
33
echo -e " \nrun conainer from [${image} ] ..."
34
34
docker run -d -t \
35
+ --privileged \
35
36
--name ${container} \
37
+ --env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
36
38
-v ` pwd` /../../../hyper-installer:/hyper-installer \
37
39
$image top
38
40
echo " ---------------------------------------------------"
@@ -45,6 +47,24 @@ Run the following command to enter container:
45
47
EOF
46
48
}
47
49
50
+ function test_hyper() {
51
+ echo -e " \ncheck conainer from [${image} ] ..."
52
+ cnt=` docker ps -a --filter=" name=${container} " | wc -l`
53
+ if [ $cnt -eq 1 ]; then
54
+ run
55
+ fi
56
+ docker exec -it ${container} bash -c " curl -sSL https://hyper.sh/install | bash"
57
+ }
58
+
59
+ function test_hypercontainer() {
60
+ echo -e " \ncheck conainer from [${image} ] ..."
61
+ cnt=` docker ps -a --filter=" name=${container} " | wc -l`
62
+ if [ $cnt -eq 1 ]; then
63
+ run
64
+ fi
65
+ docker exec -it ${container} bash -c " curl -sSL https://hypercontainer.io/install | bash"
66
+ }
67
+
48
68
case " $1 " in
49
69
" build" )
50
70
build
@@ -56,12 +76,20 @@ case "$1" in
56
76
" run" )
57
77
run
58
78
;;
79
+ " test_hyper" )
80
+ test_hyper
81
+ ;;
82
+ " test_hypercontainer" )
83
+ test_hypercontainer
84
+ ;;
59
85
* )
60
86
cat << EOF
61
87
usage:
62
- ./util.sh build # build only
63
- ./util.sh push # build and push
64
- ./util.sh run # run only
88
+ ./util.sh build # build only
89
+ ./util.sh push # build and push
90
+ ./util.sh run # run only
91
+ ./util.sh test_hyper # test install script for hypercli of Hyper.sh
92
+ ./util.sh test_hypercontainer # test install script for hypercontainer
65
93
EOF
66
94
exit 1
67
95
;;
Original file line number Diff line number Diff line change @@ -6,5 +6,11 @@ COPY sources.list.jessie /etc/apt/sources.list
6
6
7
7
# qemu 2.1.2
8
8
RUN apt-get update \
9
- && apt-get install -y --no-install-recommends qemu-kvm qemu libvirt0 wget vim \
9
+ && apt-get install -y --no-install-recommends qemu-kvm qemu libvirt0 \
10
+ wget curl git vim ca-certificates \
10
11
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
12
+
13
+ RUN cd /root/ && wget http://launchpadlibrarian.net/211288612/dmsetup_1.02.99-1ubuntu1_amd64.deb \
14
+ && wget http://launchpadlibrarian.net/211288609/libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb \
15
+ && dpkg -i libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb dmsetup_1.02.99-1ubuntu1_amd64.deb \
16
+ && rm -rf libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb dmsetup_1.02.99-1ubuntu1_amd64.deb
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ function run() {
32
32
fi
33
33
echo -e " \nrun conainer from [${image} ] ..."
34
34
docker run -d -t \
35
+ --privileged \
35
36
--name ${container} \
37
+ --env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
36
38
-v ` pwd` /../../../hyper-installer:/hyper-installer \
37
39
$image top
38
40
echo " ---------------------------------------------------"
@@ -45,6 +47,24 @@ Run the following command to enter container:
45
47
EOF
46
48
}
47
49
50
+ function test_hyper() {
51
+ echo -e " \ncheck conainer from [${image} ] ..."
52
+ cnt=` docker ps -a --filter=" name=${container} " | wc -l`
53
+ if [ $cnt -eq 1 ]; then
54
+ run
55
+ fi
56
+ docker exec -it ${container} bash -c " curl -sSL https://hyper.sh/install | bash"
57
+ }
58
+
59
+ function test_hypercontainer() {
60
+ echo -e " \ncheck conainer from [${image} ] ..."
61
+ cnt=` docker ps -a --filter=" name=${container} " | wc -l`
62
+ if [ $cnt -eq 1 ]; then
63
+ run
64
+ fi
65
+ docker exec -it ${container} bash -c " curl -sSL https://hypercontainer.io/install | bash"
66
+ }
67
+
48
68
case " $1 " in
49
69
" build" )
50
70
build
@@ -56,12 +76,20 @@ case "$1" in
56
76
" run" )
57
77
run
58
78
;;
79
+ " test_hyper" )
80
+ test_hyper
81
+ ;;
82
+ " test_hypercontainer" )
83
+ test_hypercontainer
84
+ ;;
59
85
* )
60
86
cat << EOF
61
87
usage:
62
- ./util.sh build # build only
63
- ./util.sh push # build and push
64
- ./util.sh run # run only
88
+ ./util.sh build # build only
89
+ ./util.sh push # build and push
90
+ ./util.sh run # run only
91
+ ./util.sh test_hyper # test install script for hypercli of Hyper.sh
92
+ ./util.sh test_hypercontainer # test install script for hypercontainer
65
93
EOF
66
94
exit 1
67
95
;;
Original file line number Diff line number Diff line change 1
1
FROM fedora:23
2
2
MAINTAINER Jimmy Xu <
[email protected] >
3
3
4
- RUN dnf -y install qemu-kvm wget vim && dnf clean all
4
+ RUN dnf -y install qemu-kvm \
5
+ wget curl git vim tar ca-certificates \
6
+ && dnf clean all
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ function run() {
32
32
fi
33
33
echo -e " \nrun conainer from [${image} ] ..."
34
34
docker run -d -t \
35
+ --privileged \
35
36
--name ${container} \
37
+ --env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
36
38
-v ` pwd` /../../../hyper-installer:/hyper-installer \
37
39
$image top
38
40
echo " ---------------------------------------------------"
@@ -45,6 +47,24 @@ Run the following command to enter container:
45
47
EOF
46
48
}
47
49
50
+ function test_hyper() {
51
+ echo -e " \ncheck conainer from [${image} ] ..."
52
+ cnt=` docker ps -a --filter=" name=${container} " | wc -l`
53
+ if [ $cnt -eq 1 ]; then
54
+ run
55
+ fi
56
+ docker exec -it ${container} bash -c " curl -sSL https://hyper.sh/install | bash"
57
+ }
58
+
59
+ function test_hypercontainer() {
60
+ echo -e " \ncheck conainer from [${image} ] ..."
61
+ cnt=` docker ps -a --filter=" name=${container} " | wc -l`
62
+ if [ $cnt -eq 1 ]; then
63
+ run
64
+ fi
65
+ docker exec -it ${container} bash -c " curl -sSL https://hypercontainer.io/install | bash"
66
+ }
67
+
48
68
case " $1 " in
49
69
" build" )
50
70
build
@@ -56,12 +76,20 @@ case "$1" in
56
76
" run" )
57
77
run
58
78
;;
79
+ " test_hyper" )
80
+ test_hyper
81
+ ;;
82
+ " test_hypercontainer" )
83
+ test_hypercontainer
84
+ ;;
59
85
* )
60
86
cat << EOF
61
87
usage:
62
- ./util.sh build # build only
63
- ./util.sh push # build and push
64
- ./util.sh run # run only
88
+ ./util.sh build # build only
89
+ ./util.sh push # build and push
90
+ ./util.sh run # run only
91
+ ./util.sh test_hyper # test install script for hypercli of Hyper.sh
92
+ ./util.sh test_hypercontainer # test install script for hypercontainer
65
93
EOF
66
94
exit 1
67
95
;;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ COPY sources.list.xenial /etc/apt/sources.list
6
6
7
7
# qemu 2.5.0
8
8
RUN apt-get update \
9
- && apt-get install -y --no-install-recommends qemu-kvm qemu wget vim \
9
+ && apt-get install -y --no-install-recommends qemu-kvm qemu \
10
10
libavahi-client3 libavahi-common3 libnl-3-200 libxml2 libicu55 xml-core sgml-base libavahi-common-data libvirt0 \
11
+ wget curl git vim ca-certificates \
11
12
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ function run() {
32
32
fi
33
33
echo -e " \nrun conainer from [${image} ] ..."
34
34
docker run -d -t \
35
+ --privileged \
35
36
--name ${container} \
37
+ --env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
36
38
-v ` pwd` /../../../hyper-installer:/hyper-installer \
37
39
$image top
38
40
echo " ---------------------------------------------------"
@@ -45,6 +47,24 @@ Run the following command to enter container:
45
47
EOF
46
48
}
47
49
50
+ function test_hyper() {
51
+ echo -e " \ncheck conainer from [${image} ] ..."
52
+ cnt=` docker ps -a --filter=" name=${container} " | wc -l`
53
+ if [ $cnt -eq 1 ]; then
54
+ run
55
+ fi
56
+ docker exec -it ${container} bash -c " curl -sSL https://hyper.sh/install | bash"
57
+ }
58
+
59
+ function test_hypercontainer() {
60
+ echo -e " \ncheck conainer from [${image} ] ..."
61
+ cnt=` docker ps -a --filter=" name=${container} " | wc -l`
62
+ if [ $cnt -eq 1 ]; then
63
+ run
64
+ fi
65
+ docker exec -it ${container} bash -c " curl -sSL https://hypercontainer.io/install | bash"
66
+ }
67
+
48
68
case " $1 " in
49
69
" build" )
50
70
build
@@ -56,12 +76,20 @@ case "$1" in
56
76
" run" )
57
77
run
58
78
;;
79
+ " test_hyper" )
80
+ test_hyper
81
+ ;;
82
+ " test_hypercontainer" )
83
+ test_hypercontainer
84
+ ;;
59
85
* )
60
86
cat << EOF
61
87
usage:
62
- ./util.sh build # build only
63
- ./util.sh push # build and push
64
- ./util.sh run # run only
88
+ ./util.sh build # build only
89
+ ./util.sh push # build and push
90
+ ./util.sh run # run only
91
+ ./util.sh test_hyper # test install script for hypercli of Hyper.sh
92
+ ./util.sh test_hypercontainer # test install script for hypercontainer
65
93
EOF
66
94
exit 1
67
95
;;
You can’t perform that action at this time.
0 commit comments