This commit is contained in:
2015-06-05 14:09:36 +01:00
parent 4c74bdab15
commit bcc1194d48
12 changed files with 376 additions and 8 deletions

1
bin/test/attach Normal file
View File

@@ -0,0 +1 @@
lxc-attach -n `docker ps --no-trunc | grep $1: | cut -d' ' -f1`

14
bin/test/config Normal file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
set -e
command_test() {
echo "$@"
echo "$1"
}
command_remove() {
cat bla | xargs echo
}
command_test bla
command_test bla da ra

2
bin/test/enter Normal file
View File

@@ -0,0 +1,2 @@
PID=`docker inspect -f "{{ .State.Pid }}" $1`
nsenter --target $PID --mount --uts --ipc --net --pid -- /bin/bash -l

1
bin/test/pidenter Normal file
View File

@@ -0,0 +1 @@
nsenter --target $1 --mount --uts --ipc --net --pid -- /bin/bash -l

51
bin/test/setup Normal file
View File

@@ -0,0 +1,51 @@
#!/bin/sh
set -e
#
# This script is meant for quick & easy install via:
# 'curl -sL https://raw.githubusercontent.com/Boukefalos/docker-deployment/master/setup | sh'
# or:
# 'wget -qO- https://raw.githubusercontent.com/Boukefalos/docker-deployment/master/setup | sh'
home=/opt/docker
url='https://get.docker.io/'
command_exists() {
command -v "$@" > /dev/null 2>&1
}
if ! command_exists docker; then
echo Docker should be installed!
exit 0
fi
user="$(id -un 2>/dev/null || true)"
sh_c='sh -c'
if [ "$user" != 'root' ]; then
if command_exists sudo; then
sh_c='sudo sh -c'
elif command_exists su; then
sh_c='su -c'
else
echo >&2 'Error: this installer needs the ability to run commands as root.'
echo >&2 'We are unable to find either "sudo" or "su" available to make this happen.'
exit 1
fi
fi
curl=''
if command_exists curl; then
curl='curl -sL'
elif command_exists wget; then
curl='wget -qO-'
elif command_exists busybox && busybox --list-modules | grep -q wget; then
curl='busybox wget -qO-'
fi
if [ -z "$DOCKER_HOME" ]; then
echo "DOCKER_HOME has not been set, defaulting to $home"
export DOCKER_HOME=$home
$sh_c "echo DOCKER_HOME=$home >> /etc/environment"
fi
mkdir -p $DOCKER_HOME

7
bin/test/test Normal file
View File

@@ -0,0 +1,7 @@
docker run -t -i -n=false \
--lxc-conf="lxc.network.type = veth" \
--lxc-conf="lxc.network.flags = up" \
--lxc-conf="lxc.network.link = br0" \
--lxc-conf="lxc.network.ipv4 = 10.0.2.123" \
--lxc-conf="lxc.network.ipv4.gateway=10.0.2.15" \
hamachi /bin/bash