Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit d900cdc

Browse files
authored
Merge pull request #19 from Jimmy-Xu/improve
[improve] 1.change http to https for hypercontainer 2.add "./util.sh …
2 parents 7701bbf + be72265 commit d900cdc

File tree

10 files changed

+169
-19
lines changed

10 files changed

+169
-19
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ $ wget -qO- https://hyper.sh/install | bash
1515

1616
## install hypercontainer
1717

18-
website: http://hypercontainer.io
18+
website: https://hypercontainer.io
1919

2020
```
21-
$ curl -sSL http://hypercontainer.io/install | bash
21+
$ curl -sSL https://hypercontainer.io/install | bash
2222
or
23-
$ wget -qO- http://hypercontainer.io/install | bash
23+
$ wget -qO- https://hypercontainer.io/install | bash
2424
```

docker/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
```

docker/centos/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
FROM centos:7.2.1511
22
MAINTAINER Jimmy Xu <[email protected]>
33

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

docker/centos/util.sh

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function run() {
3232
fi
3333
echo -e "\nrun conainer from [${image}] ..."
3434
docker run -d -t \
35+
--privileged \
3536
--name ${container} \
37+
--env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
3638
-v `pwd`/../../../hyper-installer:/hyper-installer \
3739
$image top
3840
echo "---------------------------------------------------"
@@ -45,6 +47,24 @@ Run the following command to enter container:
4547
EOF
4648
}
4749

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+
4868
case "$1" in
4969
"build")
5070
build
@@ -56,12 +76,20 @@ case "$1" in
5676
"run")
5777
run
5878
;;
79+
"test_hyper")
80+
test_hyper
81+
;;
82+
"test_hypercontainer")
83+
test_hypercontainer
84+
;;
5985
*)
6086
cat <<EOF
6187
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
6593
EOF
6694
exit 1
6795
;;

docker/debian/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@ COPY sources.list.jessie /etc/apt/sources.list
66

77
#qemu 2.1.2
88
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 \
1011
&& 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

docker/debian/util.sh

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function run() {
3232
fi
3333
echo -e "\nrun conainer from [${image}] ..."
3434
docker run -d -t \
35+
--privileged \
3536
--name ${container} \
37+
--env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
3638
-v `pwd`/../../../hyper-installer:/hyper-installer \
3739
$image top
3840
echo "---------------------------------------------------"
@@ -45,6 +47,24 @@ Run the following command to enter container:
4547
EOF
4648
}
4749

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+
4868
case "$1" in
4969
"build")
5070
build
@@ -56,12 +76,20 @@ case "$1" in
5676
"run")
5777
run
5878
;;
79+
"test_hyper")
80+
test_hyper
81+
;;
82+
"test_hypercontainer")
83+
test_hypercontainer
84+
;;
5985
*)
6086
cat <<EOF
6187
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
6593
EOF
6694
exit 1
6795
;;

docker/fedora/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
FROM fedora:23
22
MAINTAINER Jimmy Xu <[email protected]>
33

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

docker/fedora/util.sh

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function run() {
3232
fi
3333
echo -e "\nrun conainer from [${image}] ..."
3434
docker run -d -t \
35+
--privileged \
3536
--name ${container} \
37+
--env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
3638
-v `pwd`/../../../hyper-installer:/hyper-installer \
3739
$image top
3840
echo "---------------------------------------------------"
@@ -45,6 +47,24 @@ Run the following command to enter container:
4547
EOF
4648
}
4749

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+
4868
case "$1" in
4969
"build")
5070
build
@@ -56,12 +76,20 @@ case "$1" in
5676
"run")
5777
run
5878
;;
79+
"test_hyper")
80+
test_hyper
81+
;;
82+
"test_hypercontainer")
83+
test_hypercontainer
84+
;;
5985
*)
6086
cat <<EOF
6187
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
6593
EOF
6694
exit 1
6795
;;

docker/ubuntu/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ COPY sources.list.xenial /etc/apt/sources.list
66

77
# qemu 2.5.0
88
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 \
1010
libavahi-client3 libavahi-common3 libnl-3-200 libxml2 libicu55 xml-core sgml-base libavahi-common-data libvirt0 \
11+
wget curl git vim ca-certificates \
1112
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

docker/ubuntu/util.sh

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ function run() {
3232
fi
3333
echo -e "\nrun conainer from [${image}] ..."
3434
docker run -d -t \
35+
--privileged \
3536
--name ${container} \
37+
--env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
3638
-v `pwd`/../../../hyper-installer:/hyper-installer \
3739
$image top
3840
echo "---------------------------------------------------"
@@ -45,6 +47,24 @@ Run the following command to enter container:
4547
EOF
4648
}
4749

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+
4868
case "$1" in
4969
"build")
5070
build
@@ -56,12 +76,20 @@ case "$1" in
5676
"run")
5777
run
5878
;;
79+
"test_hyper")
80+
test_hyper
81+
;;
82+
"test_hypercontainer")
83+
test_hypercontainer
84+
;;
5985
*)
6086
cat <<EOF
6187
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
6593
EOF
6694
exit 1
6795
;;

0 commit comments

Comments
 (0)