Skip to content

Instantly share code, notes, and snippets.

@eloylp
Last active February 3, 2020 10:43
Show Gist options
  • Save eloylp/f05b4de931cc0a0cdd1e713b015639ba to your computer and use it in GitHub Desktop.
Save eloylp/f05b4de931cc0a0cdd1e713b015639ba to your computer and use it in GitHub Desktop.
Install docker and expose docker daemon over TCP. Prepared for GCP metadata startup script.
#!/bin/bash
curl -fsSL https://get.docker.com | bash
DOCKER_CONFIG_OVERRIDE_DIR=/etc/systemd/system/docker.service.d
mkdir -p $DOCKER_CONFIG_OVERRIDE_DIR
cat <<EOF > $DOCKER_CONFIG_OVERRIDE_DIR/override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376
EOF
systemctl daemon-reload
systemctl restart docker.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment