Skip to content

Commit

Permalink
Merge pull request kubernetes#20281 from cilium-team/fixing-docker-d
Browse files Browse the repository at this point in the history
Auto commit by PR queue bot
  • Loading branch information
k8s-merge-robot committed Feb 28, 2016
2 parents 5ecbf4f + 97acdf4 commit a0b04a6
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cluster/saltbase/salt/docker/docker.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Requires=docker.socket

[Service]
EnvironmentFile={{ environment_file }}
ExecStart=/usr/bin/docker -d -H fd:// "$DOCKER_OPTS"
ExecStart=/usr/bin/docker daemon -H fd:// "$DOCKER_OPTS"
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guides/coreos/bare_metal_offline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=/run/flannel/subnet.env
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]
WantedBy=multi-user.target
- name: setup-network-environment.service
Expand Down
6 changes: 6 additions & 0 deletions docs/getting-started-guides/docker-multinode/master.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,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 &'
```

_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_:
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.
Expand Down
16 changes: 12 additions & 4 deletions docs/getting-started-guides/docker-multinode/master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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
Expand Down Expand Up @@ -103,7 +103,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 \
Expand All @@ -112,15 +120,15 @@ bootstrap_daemon() {
--graph=/var/lib/docker-bootstrap \
2> /var/log/docker-bootstrap.log \
1> /dev/null &

sleep 5
}

# Start k8s components in containers
DOCKER_CONF=""

start_k8s(){
# Start etcd
# Start etcd
docker -H unix:///var/run/docker-bootstrap.sock run \
--restart=on-failure \
--net=host \
Expand Down
8 changes: 7 additions & 1 deletion docs/getting-started-guides/docker-multinode/worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,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 &'
```

_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_:
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.
Expand Down Expand Up @@ -173,7 +179,7 @@ sudo docker run \
--volume=/var/run:/var/run:rw \
--net=host \
--privileged=true \
--pid=host \
--pid=host \
-d \
gcr.io/google_containers/hyperkube-amd64:v${K8S_VERSION} \
/hyperkube kubelet \
Expand Down
16 changes: 12 additions & 4 deletions docs/getting-started-guides/docker-multinode/worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,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
Expand Down Expand Up @@ -100,7 +100,15 @@ detect_lsb() {

# Start the 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 \
-p /var/run/docker-bootstrap.pid \
--iptables=false \
Expand Down Expand Up @@ -175,7 +183,7 @@ start_k8s() {

# sleep a little bit
sleep 5

# Start kubelet & proxy in container
# TODO: Use secure port for communication
docker run \
Expand All @@ -199,7 +207,7 @@ start_k8s() {
--cluster-domain=cluster.local \
--containerized \
--v=2

docker run \
-d \
--net=host \
Expand Down

0 comments on commit a0b04a6

Please sign in to comment.