Created
March 27, 2019 15:16
-
-
Save sweepies/eb2d12d066b55e98f2768040ad4505f4 to your computer and use it in GitHub Desktop.
Run docker-compose in docker
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/sh | |
# Includes release candidate versions | |
if [ -t 0 ]; then OPTS='-it'; fi | |
latest=$(curl -s https://registry.hub.docker.com/v2/repositories/docker/compose/tags/ | jq -r '.results[0].name') | |
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \ | |
-v "$(pwd):$(pwd)" -w "$(pwd)" \ | |
$OPTS docker/compose:"$latest" ${1+"$@"} |
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/sh | |
# Does not include release candidates, but fetches from GitHub instead of Docker Hub | |
# (so it's possible the tag won't exist on Docker Hub) | |
if [ -t 0 ]; then OPTS='-it'; fi | |
latest=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.tag_name') | |
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \ | |
-v "$(pwd):$(pwd)" -w "$(pwd)" \ | |
$OPTS docker/compose:"$latest" ${1+"$@"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment