fixing docker -d deprecation

Signed-off-by: André Martins <aanm90@gmail.com>
This commit is contained in:
André Martins
2016-01-28 19:35:14 +00:00
parent 146a9e6075
commit 97acdf4cd8
6 changed files with 39 additions and 11 deletions

View File

@@ -61,7 +61,7 @@ detect_lsb() {
*64)
;;
*)
echo "Error: We currently only support 64-bit platforms."
echo "Error: We currently only support 64-bit platforms."
exit 1
;;
esac
@@ -98,7 +98,15 @@ detect_lsb() {
# Start the bootstrap daemon
# TODO: do not start docker-bootstrap if it's already running
bootstrap_daemon() {
docker -d \
# Detecting docker version so we could run proper docker_daemon command
[[ $(eval "docker --version") =~ ([0-9][.][0-9][.][0-9]*) ]] && version="${BASH_REMATCH[1]}"
local got=$(echo -e "${version}\n1.8.0" | sed '/^$/d' | sort -nr | head -1)
if [[ "${got}" = "${version}" ]]; then
docker_daemon="docker -d"
else
docker_daemon="docker daemon"
fi
${docker_daemon} \
-H unix:///var/run/docker-bootstrap.sock \
-p /var/run/docker-bootstrap.pid \
--iptables=false \
@@ -107,7 +115,7 @@ bootstrap_daemon() {
--graph=/var/lib/docker-bootstrap \
2> /var/log/docker-bootstrap.log \
1> /dev/null &
sleep 5
}
@@ -115,7 +123,7 @@ bootstrap_daemon() {
DOCKER_CONF=""
start_k8s(){
# Start etcd
# Start etcd
docker -H unix:///var/run/docker-bootstrap.sock run \
--restart=always \
--net=host \