Skip to content

Instantly share code, notes, and snippets.

@sttts
Created March 31, 2016 10:28
Show Gist options
  • Save sttts/6704e22633aa509460c4aee4bca02bd0 to your computer and use it in GitHub Desktop.
Save sttts/6704e22633aa509460c4aee4bca02bd0 to your computer and use it in GitHub Desktop.
Install latest docker in CoreOS stable
mkdir -p /etc/systemd/system/docker.service.d
cat > /etc/systemd/system/docker.service.d/10-docker-latest.conf <<EOF
[Service]
ExecStartPre=/bin/bash -ec "test -f /var/lib/docker-latest || /usr/bin/curl -L -o /var/lib/docker-latest https://get.docker.com/builds/Linux/x86_64/docker-latest && /usr/bin/chmod +x /var/lib/docker-latest"
ExecStart=
ExecStart=/var/lib/docker-latest daemon --host=fd:// $DOCKER_OPTS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ
EOF
cat > /etc/systemd/system/usr-bin-docker.mount <<EOF
[Unit]
#!/bin/bash
Requires=docker.service
After=docker.service
[Mount]
What=/var/lib/docker-latest
Where=/usr/bin/docker
Options=bind
EOF
systemctl daemon-reload
systemctl restart docker
systemctl restart usr-bin-docker.mount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment