Created
June 13, 2019 17:09
-
-
Save rene-d/0e3db974ac58b083aa060a68cebd3469 to your computer and use it in GitHub Desktop.
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
| # Docker image downloader | |
| # download Docker images without Docker installed | |
| FROM docker:edge | |
| RUN apk add --no-cache bash curl ca-certificates jq go | |
| ADD https://raw.githubusercontent.com/moby/moby/master/contrib/download-frozen-image-v2.sh /bin/download-frozen-image | |
| RUN chmod 755 /bin/download-frozen-image | |
| WORKDIR /work | |
| #ENTRYPOINT ["/bin/download-frozen-image"] |
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 | |
| # https://devops.stackexchange.com/questions/2731/downloading-docker-images-from-docker-hub-without-using-docker | |
| set -e | |
| id=$(docker build --quiet -t download-frozen-image:latest .) | |
| if [[ $# -eq 0 ]]; then | |
| docker run --rm -ti -v $PWD:/work -v /var/run/docker.sock:/var/run/docker.sock ${id} | |
| else | |
| docker run --rm -ti -v $PWD:/work ${id} download-frozen-image $@ | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment