Last active
August 29, 2015 14:06
-
-
Save hugoduncan/48fd844072060b883671 to your computer and use it in GitHub Desktop.
Fleet services for switching to latest docker on CoreOS, and back again
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# core-docker.service | |
# Fleet global unit to restore docker to the CoreOS version | |
[Unit] | |
Wants=docker.service | |
After=docker.service | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/rm -f /run/systemd/system/docker.service.d/10-start.conf | |
ExecStart=/usr/bin/echo "Default docker daemon restored" | |
ExecStart=/bin/bash -c 'nohup bash -c "/usr/bin/systemctl daemon-reload; /usr/bin/systemctl restart docker.service;" & sleep 1;' | |
[X-Fleet] | |
Global=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# latest-docker.service | |
# Fleet global unit to update docker to the latest (or non-release) version | |
[Unit] | |
Wants=docker.service | |
After=docker.service | |
[Service] | |
Type=oneshot | |
# These can be configured to fix the the commit to use, or to ride master | |
Environment="COMMITISH=e7a9662974ad12e1926599e64dca44aaf1a90145" | |
Environment="BRANCH=master" | |
ExecStart=/bin/bash -c '[ -x /var/bin/docker ] || \ | |
docker run --privileged --rm \ | |
-v /tmp/docker-bundles:/go/src/github.com/docker/docker/bundles \ | |
docker-dev:latest \ | |
bash -c "git checkout ${BRANCH} && git pull && git checkout ${COMMITISH} && hack/make.sh binary || echo build failed";' | |
ExecStart=/usr/bin/mkdir -p /var/bin | |
ExecStart=/usr/bin/cp /tmp/docker-bundles/1.2.0-dev/binary/docker-1.2.0-dev /var/bin/docker | |
ExecStart=/usr/bin/mkdir -p /run/systemd/system/docker.service.d | |
ExecStart=/bin/bash -c 'echo "[Service]\nExecStart=\nExecStart=/var/bin/docker --daemon --storage-driver=btrfs --host=fd://" > /run/systemd/system/docker.service.d/10-start.conf' | |
ExecStart=/usr/bin/echo "Docker set to run from /var/bin/docker" | |
ExecStart=/bin/bash -c 'nohup bash -c "/usr/bin/systemctl daemon-reload; /usr/bin/systemctl restart docker.service;" & sleep 1;' | |
[Install] | |
WantedBy=multi-user.target | |
[X-Fleet] | |
Global=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment