This repository has been archived by the owner on Feb 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[master] update dockerfile for test install script
- Loading branch information
Showing
30 changed files
with
637 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hyper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,43 @@ | ||
Test hyper install script in docker container | ||
============================================= | ||
|
||
## Dependency | ||
# Install script test report | ||
|
||
| OS | hyper.sh | hypercontainer | | ||
| --- | --- | --- | | ||
| [CentOS7](centos/6) | ok | ok | | ||
| [CentOS6](centos/7) | ok | - | | ||
| [Fefora24](fedora/24) | ok | ok | | ||
| [Fefora23](fedora/23) | ok | ok | | ||
| [Ubuntu16.04(xenial)](ubuntu/xenial) | ok | ok | | ||
| [Ubuntu14.04(trusty)](ubuntu/trusty) | ok | - | | ||
| [Debian8(jessie)](debian/jessie) | ok | ok | | ||
| [Debian7(wheezy)](debian/wheezy) | ok | - | | ||
|
||
# Dependency for hypercontainer | ||
|
||
- qemu 2+ | ||
- libvirt | ||
|
||
## Usage | ||
# Test install script in docker container | ||
|
||
> example | ||
> For example: test under CentOS 7 | ||
``` | ||
cd centos | ||
```shell | ||
$ cd centos/7 | ||
|
||
//build image hyperhq/test-installer-centos:7.2.1511 | ||
./util.sh build | ||
$ ./util.sh build | ||
|
||
//run container test-installer-centos | ||
./util.sh run | ||
$ ./util.sh run | ||
|
||
//test local install script | ||
$ docker exec -it test-installer-centos-7 bash | ||
|
||
//install hypercli in container | ||
./util.sh test_hyper | ||
$ ./util.sh test_hyper | ||
|
||
//install hypercontainer in container | ||
./util.sh test_hypercontainer | ||
$ ./util.sh test_hypercontainer | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# not support hypercontainer | ||
FROM centos:6.8 | ||
MAINTAINER Jimmy Xu <[email protected]> | ||
|
||
# install common package | ||
RUN yum install -y wget curl git vim ca-certificates \ | ||
&& yum clean all | ||
|
||
# update qemu to 2.4.1 | ||
RUN yum install -y gcc libuuid-devel libaio-devel spice-server-devel zlib-devel \ | ||
gnutls-devel cyrus-sasl-devel glib2-devel libaio-devel spice-protocol flex bison libtool \ | ||
libcap-devel libattr-devel \ | ||
&& yum clean all | ||
ENV QEMU_VER 2.4.1 | ||
RUN curl -O http://wiki.qemu-project.org/download/qemu-${QEMU_VER}.tar.bz2 \ | ||
&& tar -xjf qemu-${QEMU_VER}.tar.bz2 \ | ||
&& cd qemu-${QEMU_VER} \ | ||
&& ./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 \ | ||
&& make && make install \ | ||
&& ln -s /usr/local/bin/qemu-system-x86_64 /usr/bin/qemu-system-x86_64 \ | ||
&& rm -rf qemu-${QEMU_VER}.tar.bz2 | ||
|
||
WORKDIR /hyper-installer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
repo="hyperhq/test-installer-centos" | ||
tag="6.8" | ||
image=${repo}:${tag} | ||
container="test-installer-centos-6" | ||
|
||
# DOCKER0=$(ifconfig | grep docker0 -A1 | grep "inet " | awk '{print $2}') | ||
# PROXY="http://${DOCKER0}:8118" | ||
|
||
function build(){ | ||
echo "starting build..." | ||
echo "==============================================================" | ||
CMD="docker build --build-arg http_proxy=${PROXY} --build-arg https_proxy=${PROXY} -t ${image} ." | ||
echo "CMD: [ ${CMD} ]" | ||
eval $CMD | ||
} | ||
|
||
function push(){ | ||
echo -e "\nstarting push [${image}] ..." | ||
echo "==============================================================" | ||
docker push ${image} | ||
} | ||
|
||
function run() { | ||
echo -e "\ncheck old conainer from [${image}] ..." | ||
cnt=`docker ps -a --filter="name=${container}" | wc -l` | ||
if [ $cnt -ne 1 ];then | ||
docker rm -fv ${container} | ||
fi | ||
echo -e "\nrun conainer from [${image}] ..." | ||
docker run -d -t \ | ||
--privileged \ | ||
--hostname ${container} \ | ||
--name ${container} \ | ||
--env HTTP_PROXY=$HTTP_PROXY --env HTTPS_PROXY=$HTTPS_PROXY \ | ||
-v `pwd`/../../../../hyper-installer:/hyper-installer \ | ||
$image top | ||
echo "---------------------------------------------------" | ||
docker ps -a --filter="name=${container}" | ||
cat <<EOF | ||
--------------------------------------------------- | ||
Run the following command to enter container: | ||
docker exec -it ${container} bash | ||
EOF | ||
} | ||
|
||
function test_hyper() { | ||
echo -e "\ncheck conainer from [${image}] ..." | ||
cnt=`docker ps -a --filter="name=${container}" | wc -l` | ||
if [ $cnt -eq 1 ];then | ||
run | ||
fi | ||
docker exec -it ${container} bash -c "curl -sSL https://hyper.sh/install | bash" | ||
} | ||
|
||
function test_hypercontainer() { | ||
echo -e "\ncheck conainer from [${image}] ..." | ||
cnt=`docker ps -a --filter="name=${container}" | wc -l` | ||
if [ $cnt -eq 1 ];then | ||
run | ||
fi | ||
docker exec -it ${container} bash -c "curl -sSL https://hypercontainer.io/install | bash" | ||
} | ||
|
||
case "$1" in | ||
"build") | ||
build | ||
;; | ||
"push") | ||
build | ||
push | ||
;; | ||
"run") | ||
run | ||
;; | ||
"test_hyper") | ||
test_hyper | ||
;; | ||
"test_hypercontainer") | ||
test_hypercontainer | ||
;; | ||
*) | ||
cat <<EOF | ||
usage: | ||
./util.sh build # build only | ||
./util.sh push # build and push | ||
./util.sh run # run only | ||
./util.sh test_hyper # test install script for hypercli of Hyper.sh | ||
./util.sh test_hypercontainer # test install script for hypercontainer | ||
EOF | ||
exit 1 | ||
;; | ||
esac | ||
|
||
|
||
|
||
echo -e "\n==============================================================" | ||
echo "Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM centos:7.2.1511 | ||
MAINTAINER Jimmy Xu <[email protected]> | ||
|
||
RUN yum install -y wget curl git vim ca-certificates \ | ||
&& yum clean all | ||
|
||
WORKDIR /hyper-installer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM debian:8.5 | ||
MAINTAINER Jimmy Xu <[email protected]> | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
COPY sources.list.jessie /etc/apt/sources.list | ||
|
||
# install common package | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends wget curl xz-utils git vim ca-certificates | ||
# && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
##################################################################### | ||
# install libvirt0(require libvirt0_1.2.16-2ubuntu11.15.10.3+) # | ||
##################################################################### | ||
## install libdbus-1-3_1.9.20 | ||
RUN apt-get install -y libapparmor1 libcap-ng0 | ||
RUN cd /root && wget http://launchpadlibrarian.net/215017531/libdbus-1-3_1.9.20-1ubuntu1_amd64.deb \ | ||
&& wget http://launchpadlibrarian.net/215017529/dbus_1.9.20-1ubuntu1_amd64.deb \ | ||
&& dpkg -i libdbus-1-3_1.9.20-1ubuntu1_amd64.deb dbus_1.9.20-1ubuntu1_amd64.deb | ||
## install libxen-4.5_4.5.1 | ||
RUN apt-get install -y libxenstore3.0 libyajl2 | ||
RUN cd /root && wget http://launchpadlibrarian.net/216308679/libxen-4.5_4.5.1-0ubuntu1_amd64.deb \ | ||
&& dpkg -i libxen-4.5_4.5.1-0ubuntu1_amd64.deb | ||
## install libvirt0_1.2.16-2 | ||
RUN apt-get install -y libavahi-client3 libavahi-common3 libnl-3-200 libnuma1 libxml2 | ||
RUN cd /root && wget http://launchpadlibrarian.net/234853156/libvirt0_1.2.16-2ubuntu11.15.10.3_amd64.deb \ | ||
&& dpkg -i libvirt0_1.2.16-2ubuntu11.15.10.3_amd64.deb | ||
|
||
## update dmsetup and libdevmapper | ||
RUN cd /root \ | ||
&& wget http://launchpadlibrarian.net/211288612/dmsetup_1.02.99-1ubuntu1_amd64.deb \ | ||
&& wget http://launchpadlibrarian.net/211288609/libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb \ | ||
&& dpkg -i libdevmapper1.02.1_1.02.99-1ubuntu1_amd64.deb \ | ||
dmsetup_1.02.99-1ubuntu1_amd64.deb | ||
|
||
########################## | ||
# install qemu # | ||
########################## | ||
RUN apt-get install -y qemu | ||
|
||
WORKDIR /hyper-installer |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# not support hypercontainer | ||
FROM debian:7.11 | ||
MAINTAINER Jimmy Xu <[email protected]> | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
COPY sources.list.wheezy /etc/apt/sources.list | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
wget curl git vim ca-certificates | ||
## && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# install qemu 2.3.0 | ||
RUN apt-get install -y make bzip2 gcc \ | ||
libgnutls-dev libsasl2-dev uuid-dev libglib2.0-dev libaio-dev libspice-server-dev libspice-protocol-dev \ | ||
libcap-dev and libattr1-dev | ||
ENV QEMU_VER 2.3.0 | ||
RUN curl -O http://wiki.qemu-project.org/download/qemu-${QEMU_VER}.tar.bz2 \ | ||
&& tar -xjf qemu-${QEMU_VER}.tar.bz2 \ | ||
&& cd qemu-${QEMU_VER} \ | ||
&& ./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 \ | ||
&& make && make install \ | ||
&& ln -s /usr/local/bin/qemu-system-x86_64 /usr/bin/qemu-system-x86_64 \ | ||
&& rm -rf qemu-${QEMU_VER}.tar.bz2 | ||
|
||
# install libvirt0 | ||
RUN apt-get install -y libvirt0 | ||
|
||
WORKDIR /hyper-installer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
deb http://mirrors.163.com/debian/ wheezy main non-free contrib | ||
deb http://mirrors.163.com/debian/ wheezy-updates main non-free contrib | ||
deb http://mirrors.163.com/debian/ wheezy-backports main non-free contrib | ||
deb http://mirrors.163.com/debian-security/ wheezy/updates main non-free contrib | ||
#deb-src http://mirrors.163.com/debian/ wheezy main non-free contrib | ||
#deb-src http://mirrors.163.com/debian/ wheezy-updates main non-free contrib | ||
#deb-src http://mirrors.163.com/debian/ wheezy-backports main non-free contrib | ||
#deb-src http://mirrors.163.com/debian-security/ wheezy/updates main non-free contrib |
Oops, something went wrong.