Last active
February 7, 2018 21:55
static #docker binary in #coreos
This file contains hidden or 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
#!/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 |
This file contains hidden or 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
[Unit] | |
Description=Static docker downloader | |
Requires=docker.service | |
Before=docker.service | |
[Service] | |
Type=oneshot | |
ExecStart=/opt/bin/get-static-docker | |
[Install] | |
WantedBy=docker.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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