mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	fixing docker -d deprecation
Signed-off-by: André Martins <aanm90@gmail.com>
This commit is contained in:
		@@ -6,7 +6,7 @@ Requires=docker.socket
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[Service]
 | 
					[Service]
 | 
				
			||||||
EnvironmentFile={{ environment_file }}
 | 
					EnvironmentFile={{ environment_file }}
 | 
				
			||||||
ExecStart=/usr/bin/docker -d -H fd:// "$DOCKER_OPTS"
 | 
					ExecStart=/usr/bin/docker daemon -H fd:// "$DOCKER_OPTS"
 | 
				
			||||||
MountFlags=slave
 | 
					MountFlags=slave
 | 
				
			||||||
LimitNOFILE=1048576
 | 
					LimitNOFILE=1048576
 | 
				
			||||||
LimitNPROC=1048576
 | 
					LimitNPROC=1048576
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -557,7 +557,7 @@ On the PXE server make and fill in the variables `vi /var/www/html/coreos/pxe-cl
 | 
				
			|||||||
            EnvironmentFile=-/etc/default/docker
 | 
					            EnvironmentFile=-/etc/default/docker
 | 
				
			||||||
            EnvironmentFile=/run/flannel/subnet.env
 | 
					            EnvironmentFile=/run/flannel/subnet.env
 | 
				
			||||||
            ExecStartPre=/bin/mount --make-rprivate /
 | 
					            ExecStartPre=/bin/mount --make-rprivate /
 | 
				
			||||||
            ExecStart=/usr/bin/docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} -s=overlay -H fd:// ${DOCKER_EXTRA_OPTS}
 | 
					            ExecStart=/usr/bin/docker daemon --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU} -s=overlay -H fd:// ${DOCKER_EXTRA_OPTS}
 | 
				
			||||||
            [Install]
 | 
					            [Install]
 | 
				
			||||||
            WantedBy=multi-user.target
 | 
					            WantedBy=multi-user.target
 | 
				
			||||||
        - name: setup-network-environment.service
 | 
					        - name: setup-network-environment.service
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,6 +70,12 @@ Run:
 | 
				
			|||||||
sudo sh -c 'docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &'
 | 
					sudo sh -c 'docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &'
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					_If you have Docker 1.8.0 or higher run this instead_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sh
 | 
				
			||||||
 | 
					sudo sh -c 'docker daemon -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &'
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
_Important Note_:
 | 
					_Important Note_:
 | 
				
			||||||
If you are running this on a long running system, rather than experimenting, you should run the bootstrap Docker instance under something like SysV init, upstart or systemd so that it is restarted
 | 
					If you are running this on a long running system, rather than experimenting, you should run the bootstrap Docker instance under something like SysV init, upstart or systemd so that it is restarted
 | 
				
			||||||
across reboots and failures.
 | 
					across reboots and failures.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,7 +98,15 @@ detect_lsb() {
 | 
				
			|||||||
# Start the bootstrap daemon
 | 
					# Start the bootstrap daemon
 | 
				
			||||||
# TODO: do not start docker-bootstrap if it's already running
 | 
					# TODO: do not start docker-bootstrap if it's already running
 | 
				
			||||||
bootstrap_daemon() {
 | 
					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 \
 | 
					        -H unix:///var/run/docker-bootstrap.sock \
 | 
				
			||||||
        -p /var/run/docker-bootstrap.pid \
 | 
					        -p /var/run/docker-bootstrap.pid \
 | 
				
			||||||
        --iptables=false \
 | 
					        --iptables=false \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -72,6 +72,12 @@ Run:
 | 
				
			|||||||
sudo sh -c 'docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &'
 | 
					sudo sh -c 'docker -d -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &'
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					_If you have Docker 1.8.0 or higher run this instead_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```sh
 | 
				
			||||||
 | 
					sudo sh -c 'docker daemon -H unix:///var/run/docker-bootstrap.sock -p /var/run/docker-bootstrap.pid --iptables=false --ip-masq=false --bridge=none --graph=/var/lib/docker-bootstrap 2> /var/log/docker-bootstrap.log 1> /dev/null &'
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
_Important Note_:
 | 
					_Important Note_:
 | 
				
			||||||
If you are running this on a long running system, rather than experimenting, you should run the bootstrap Docker instance under something like SysV init, upstart or systemd so that it is restarted
 | 
					If you are running this on a long running system, rather than experimenting, you should run the bootstrap Docker instance under something like SysV init, upstart or systemd so that it is restarted
 | 
				
			||||||
across reboots and failures.
 | 
					across reboots and failures.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,7 +96,15 @@ detect_lsb() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Start the bootstrap daemon
 | 
					# Start the bootstrap daemon
 | 
				
			||||||
bootstrap_daemon() {
 | 
					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 \
 | 
					        -H unix:///var/run/docker-bootstrap.sock \
 | 
				
			||||||
        -p /var/run/docker-bootstrap.pid \
 | 
					        -p /var/run/docker-bootstrap.pid \
 | 
				
			||||||
        --iptables=false \
 | 
					        --iptables=false \
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user