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

Commit 36f82b7

Browse files
committed
[master] update dockerfile for test install script
1 parent 97a4f18 commit 36f82b7

30 files changed

+637
-64
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hyper

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Install script for Hyper_ client and hypercontainer
1+
Install script for Hyper.sh client and hypercontainer
22
===================================================
33

44
# Usage
55

6-
## install hypercli for Hyper_
6+
## install hypercli for Hyper.sh
77

88
website: https://hyper.sh
99

@@ -15,10 +15,14 @@ $ wget -qO- https://hyper.sh/install | bash
1515

1616
## install hypercontainer
1717

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

2020
```
2121
$ curl -sSL https://hypercontainer.io/install | bash
2222
or
2323
$ wget -qO- https://hypercontainer.io/install | bash
2424
```
25+
26+
# test install script in container
27+
28+
[DETAIL](docker/README.md)

docker/README.md

+25-9
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,43 @@
11
Test hyper install script in docker container
22
=============================================
33

4-
## Dependency
4+
# Install script test report
5+
6+
| OS | hyper.sh | hypercontainer |
7+
| --- | --- | --- |
8+
| CentOS7 | ok | ok |
9+
| CentOS6 | ok | - |
10+
| Fefora24 | ok | ok |
11+
| Fefora23 | ok | ok |
12+
| Ubuntu16.04(xenial) | ok | ok |
13+
| Ubuntu14.04(trusty) | ok | - |
14+
| Debian8(jessie) | ok | ok |
15+
| Debian7(wheezy) | ok | - |
16+
17+
# Dependency for hypercontainer
518

619
- qemu 2+
720
- libvirt
821

9-
## Usage
22+
# Test install script in docker container
1023

11-
> example
24+
> For example: test under CentOS 7
1225
13-
```
14-
cd centos
26+
```shell
27+
$ cd centos/7
1528

1629
//build image hyperhq/test-installer-centos:7.2.1511
17-
./util.sh build
30+
$ ./util.sh build
1831

1932
//run container test-installer-centos
20-
./util.sh run
33+
$ ./util.sh run
34+
35+
//test local install script
36+
$ docker exec -it test-installer-centos-7 bash
2137

2238
//install hypercli in container
23-
./util.sh test_hyper
39+
$ ./util.sh test_hyper
2440

2541
//install hypercontainer in container
26-
./util.sh test_hypercontainer
42+
$ ./util.sh test_hypercontainer
2743
```

docker/centos/6/Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# not support hypercontainer
2+
FROM centos:6.8
3+
MAINTAINER Jimmy Xu <[email protected]>
4+
5+
# install common package
6+
RUN yum install -y wget curl git vim ca-certificates \
7+
&& yum clean all
8+
9+
# update qemu to 2.4.1
10+
RUN yum install -y gcc libuuid-devel libaio-devel spice-server-devel zlib-devel \
11+
gnutls-devel cyrus-sasl-devel glib2-devel libaio-devel spice-protocol flex bison libtool \
12+
libcap-devel libattr-devel \
13+
&& yum clean all
14+
ENV QEMU_VER 2.4.1
15+
RUN curl -O http://wiki.qemu-project.org/download/qemu-${QEMU_VER}.tar.bz2 \
16+
&& tar -xjf qemu-${QEMU_VER}.tar.bz2 \
17+
&& cd qemu-${QEMU_VER} \
18+
&& ./configure --prefix=/usr/local/ --target-list=x86_64-softmmu --enable-vnc --disable-xen --enable-vnc-tls --enable-vnc-sasl --enable-kvm --enable-linux-aio --disable-docs --enable-vhost-net --disable-libiscsi --disable-smartcard-nss --enable-debug --enable-uuid --enable-virtfs \
19+
&& make && make install \
20+
&& ln -s /usr/local/bin/qemu-system-x86_64 /usr/bin/qemu-system-x86_64 \
21+
&& rm -rf qemu-${QEMU_VER}.tar.bz2
22+
23+
WORKDIR /hyper-installer

docker/centos/6/util.sh

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
repo="hyperhq/test-installer-centos"
6+
tag="6.8"
7+
image=${repo}:${tag}
8+
container="test-installer-centos-6"
9+
10+
# DOCKER0=$(ifconfig | grep docker0 -A1 | grep "inet " | awk '{print $2}')
11+
# PROXY="http://${DOCKER0}:8118"
12+
13+
function build(){
14+
echo "starting build..."
15+
echo "=============================================================="
16+
CMD="docker build --build-arg http_proxy=${PROXY} --build-arg https_proxy=${PROXY} -t ${image} ."
17+
echo "CMD: [ ${CMD} ]"
18+
eval $CMD
19+
}
20+
21+
function push(){
22+
echo -e "\nstarting push [${image}] ..."
23+
echo "=============================================================="
24+
docker push ${image}
25+
}
26+
27+
function run() {
28+
echo -e "\ncheck old conainer from [${image}] ..."
29+
cnt=`docker ps -a --filter="name=${container}" | wc -l`
30+
if [ $cnt -ne 1 ];then
31+
docker rm -fv ${container}
32+
fi
33+
echo -e "\nrun conainer from [${image}] ..."
34+
docker run -d -t \
35+
--privileged \
36+
--hostname ${container} \
37+
--name ${container} \
38+
--env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
39+
-v `pwd`/../../../../hyper-installer:/hyper-installer \
40+
$image top
41+
echo "---------------------------------------------------"
42+
docker ps -a --filter="name=${container}"
43+
cat <<EOF
44+
45+
---------------------------------------------------
46+
Run the following command to enter container:
47+
docker exec -it ${container} bash
48+
EOF
49+
}
50+
51+
function test_hyper() {
52+
echo -e "\ncheck conainer from [${image}] ..."
53+
cnt=`docker ps -a --filter="name=${container}" | wc -l`
54+
if [ $cnt -eq 1 ];then
55+
run
56+
fi
57+
docker exec -it ${container} bash -c "curl -sSL https://hyper.sh/install | bash"
58+
}
59+
60+
function test_hypercontainer() {
61+
echo -e "\ncheck conainer from [${image}] ..."
62+
cnt=`docker ps -a --filter="name=${container}" | wc -l`
63+
if [ $cnt -eq 1 ];then
64+
run
65+
fi
66+
docker exec -it ${container} bash -c "curl -sSL https://hypercontainer.io/install | bash"
67+
}
68+
69+
case "$1" in
70+
"build")
71+
build
72+
;;
73+
"push")
74+
build
75+
push
76+
;;
77+
"run")
78+
run
79+
;;
80+
"test_hyper")
81+
test_hyper
82+
;;
83+
"test_hypercontainer")
84+
test_hypercontainer
85+
;;
86+
*)
87+
cat <<EOF
88+
usage:
89+
./util.sh build # build only
90+
./util.sh push # build and push
91+
./util.sh run # run only
92+
./util.sh test_hyper # test install script for hypercli of Hyper.sh
93+
./util.sh test_hypercontainer # test install script for hypercontainer
94+
EOF
95+
exit 1
96+
;;
97+
esac
98+
99+
100+
101+
echo -e "\n=============================================================="
102+
echo "Done!"

docker/centos/7/Dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM centos:7.2.1511
2+
MAINTAINER Jimmy Xu <[email protected]>
3+
4+
RUN yum install -y wget curl git vim ca-certificates \
5+
&& yum clean all
6+
7+
WORKDIR /hyper-installer

docker/centos/util.sh renamed to docker/centos/7/util.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
repo="hyperhq/test-installer-centos"
66
tag="7.2.1511"
77
image=${repo}:${tag}
8-
container="test-installer-centos"
8+
container="test-installer-centos-7"
99

1010
# DOCKER0=$(ifconfig | grep docker0 -A1 | grep "inet " | awk '{print $2}')
1111
# PROXY="http://${DOCKER0}:8118"
@@ -33,9 +33,10 @@ function run() {
3333
echo -e "\nrun conainer from [${image}] ..."
3434
docker run -d -t \
3535
--privileged \
36+
--hostname ${container} \
3637
--name ${container} \
3738
--env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
38-
-v `pwd`/../../../hyper-installer:/hyper-installer \
39+
-v `pwd`/../../../../hyper-installer:/hyper-installer \
3940
$image top
4041
echo "---------------------------------------------------"
4142
docker ps -a --filter="name=${container}"

docker/centos/Dockerfile

-6
This file was deleted.

docker/debian/Dockerfile

-16
This file was deleted.

docker/debian/jessie/Dockerfile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM debian:8.5
2+
MAINTAINER Jimmy Xu <[email protected]>
3+
4+
ENV DEBIAN_FRONTEND noninteractive
5+
COPY sources.list.jessie /etc/apt/sources.list
6+
7+
# install common package
8+
RUN apt-get update \
9+
&& apt-get install -y --no-install-recommends wget curl xz-utils git vim ca-certificates
10+
# && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
11+
12+
#####################################################################
13+
# install libvirt0(require libvirt0_1.2.16-2ubuntu11.15.10.3+) #
14+
#####################################################################
15+
## install libdbus-1-3_1.9.20
16+
RUN apt-get install -y libapparmor1 libcap-ng0
17+
RUN cd /root && wget http://launchpadlibrarian.net/215017531/libdbus-1-3_1.9.20-1ubuntu1_amd64.deb \
18+
&& wget http://launchpadlibrarian.net/215017529/dbus_1.9.20-1ubuntu1_amd64.deb \
19+
&& dpkg -i libdbus-1-3_1.9.20-1ubuntu1_amd64.deb dbus_1.9.20-1ubuntu1_amd64.deb
20+
## install libxen-4.5_4.5.1
21+
RUN apt-get install -y libxenstore3.0 libyajl2
22+
RUN cd /root && wget http://launchpadlibrarian.net/216308679/libxen-4.5_4.5.1-0ubuntu1_amd64.deb \
23+
&& dpkg -i libxen-4.5_4.5.1-0ubuntu1_amd64.deb
24+
## install libvirt0_1.2.16-2
25+
RUN apt-get install -y libavahi-client3 libavahi-common3 libnl-3-200 libnuma1 libxml2
26+
RUN cd /root && wget http://launchpadlibrarian.net/234853156/libvirt0_1.2.16-2ubuntu11.15.10.3_amd64.deb \
27+
&& dpkg -i libvirt0_1.2.16-2ubuntu11.15.10.3_amd64.deb
28+
29+
## update dmsetup and libdevmapper
30+
RUN cd /root \
31+
&& wget http://launchpadlibrarian.net/211288612/dmsetup_1.02.99-1ubuntu1_amd64.deb \
32+
&& wget http://launchpadlibrarian.net/211288609/libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb \
33+
&& dpkg -i libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb \
34+
dmsetup_1.02.99-1ubuntu1_amd64.deb
35+
36+
##########################
37+
# install qemu #
38+
##########################
39+
RUN apt-get install -y qemu
40+
41+
WORKDIR /hyper-installer

docker/debian/util.sh renamed to docker/debian/jessie/util.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55
repo="hyperhq/test-installer-debian"
66
tag="8.5"
77
image=${repo}:${tag}
8-
container="test-installer-debian"
8+
container="test-installer-debian-jessie"
99

1010
# DOCKER0=$(ifconfig | grep docker0 -A1 | grep "inet " | awk '{print $2}')
1111
# PROXY="http://${DOCKER0}:8118"
@@ -33,9 +33,10 @@ function run() {
3333
echo -e "\nrun conainer from [${image}] ..."
3434
docker run -d -t \
3535
--privileged \
36+
--hostname ${container} \
3637
--name ${container} \
3738
--env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \
38-
-v `pwd`/../../../hyper-installer:/hyper-installer \
39+
-v `pwd`/../../../../hyper-installer:/hyper-installer \
3940
$image top
4041
echo "---------------------------------------------------"
4142
docker ps -a --filter="name=${container}"

docker/debian/wheezy/Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# not support hypercontainer
2+
FROM debian:7.11
3+
MAINTAINER Jimmy Xu <[email protected]>
4+
5+
ENV DEBIAN_FRONTEND noninteractive
6+
COPY sources.list.wheezy /etc/apt/sources.list
7+
8+
RUN apt-get update \
9+
&& apt-get install -y --no-install-recommends \
10+
wget curl git vim ca-certificates
11+
## && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
12+
13+
# install qemu 2.3.0
14+
RUN apt-get install -y make bzip2 gcc \
15+
libgnutls-dev libsasl2-dev uuid-dev libglib2.0-dev libaio-dev libspice-server-dev libspice-protocol-dev \
16+
libcap-dev and libattr1-dev
17+
ENV QEMU_VER 2.3.0
18+
RUN curl -O http://wiki.qemu-project.org/download/qemu-${QEMU_VER}.tar.bz2 \
19+
&& tar -xjf qemu-${QEMU_VER}.tar.bz2 \
20+
&& cd qemu-${QEMU_VER} \
21+
&& ./configure --prefix=/usr/local/ --target-list=x86_64-softmmu --enable-vnc --disable-xen --enable-vnc-tls --enable-vnc-sasl --enable-kvm --enable-linux-aio --disable-docs --enable-vhost-net --disable-libiscsi --disable-smartcard-nss --enable-debug --enable-uuid --enable-virtfs \
22+
&& make && make install \
23+
&& ln -s /usr/local/bin/qemu-system-x86_64 /usr/bin/qemu-system-x86_64 \
24+
&& rm -rf qemu-${QEMU_VER}.tar.bz2
25+
26+
# install libvirt0
27+
RUN apt-get install -y libvirt0
28+
29+
WORKDIR /hyper-installer
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
deb http://mirrors.163.com/debian/ wheezy main non-free contrib
2+
deb http://mirrors.163.com/debian/ wheezy-updates main non-free contrib
3+
deb http://mirrors.163.com/debian/ wheezy-backports main non-free contrib
4+
deb http://mirrors.163.com/debian-security/ wheezy/updates main non-free contrib
5+
#deb-src http://mirrors.163.com/debian/ wheezy main non-free contrib
6+
#deb-src http://mirrors.163.com/debian/ wheezy-updates main non-free contrib
7+
#deb-src http://mirrors.163.com/debian/ wheezy-backports main non-free contrib
8+
#deb-src http://mirrors.163.com/debian-security/ wheezy/updates main non-free contrib

0 commit comments

Comments
 (0)