Skip to content

Instantly share code, notes, and snippets.

@sigma
Last active February 7, 2018 21:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sigma/077606735bb738a73fb2 to your computer and use it in GitHub Desktop.
Save sigma/077606735bb738a73fb2 to your computer and use it in GitHub Desktop.
static #docker binary in #coreos
#!/bin/bash
VERSION=$(docker --version | awk '{print $3}' | sed 's/,//')
BINARY="/opt/bin/docker-$VERSION-static"
LINK="/opt/bin/docker.static"
if [ ! -e "$BINARY" ]; then
curl -L -o "$BINARY" "https://get.docker.com/builds/Linux/x86_64/docker-$VERSION"
chmod a+x "$BINARY"
ln -sf "$BINARY" "$LINK"
fi
[Unit]
Description=Static docker downloader
Requires=docker.service
Before=docker.service
[Service]
Type=oneshot
ExecStart=/opt/bin/get-static-docker
[Install]
WantedBy=docker.service
@sigma
Copy link
Author

sigma commented Oct 25, 2015

@jfchevrette this is useful for cases where you want to use docker-in-docker, and be guaranteed that the inner one is compatible with the outer one (since docker basically doesn't have any useful notion of compatibility).

With this, you can just bind-mount the static docker binary, and you get those properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment