diff --git a/.template-helpers/variant-buildpacks.md b/.template-helpers/variant-buildpacks.md new file mode 100644 index 00000000..554a78c4 --- /dev/null +++ b/.template-helpers/variant-buildpacks.md @@ -0,0 +1,7 @@ +# Image Variants + +The `%%REPO%%` images come in many flavors, each designed for a specific use case. + +## `%%REPO%%:` + +This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of [`buildpack-deps`](https://registry.hub.docker.com/_/buildpack-deps/). `buildpack-deps` is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system. diff --git a/.template-helpers/variant.md b/.template-helpers/variant.md index 554a78c4..efcccf49 100644 --- a/.template-helpers/variant.md +++ b/.template-helpers/variant.md @@ -4,4 +4,4 @@ The `%%REPO%%` images come in many flavors, each designed for a specific use cas ## `%%REPO%%:` -This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of [`buildpack-deps`](https://registry.hub.docker.com/_/buildpack-deps/). `buildpack-deps` is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system. +This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. diff --git a/.template-helpers/variant.sh b/.template-helpers/variant.sh index 86c5a600..1f6c7af2 100755 --- a/.template-helpers/variant.sh +++ b/.template-helpers/variant.sh @@ -9,9 +9,10 @@ if [ -z "$repo" ]; then fi dir="$(dirname "$(readlink -f "$BASH_SOURCE")")" +url='https://raw.githubusercontent.com/docker-library/official-images/master/library/'"$repo" IFS=$'\n' -tags=( $(curl -sSL 'https://raw.githubusercontent.com/docker-library/official-images/master/library/'"$repo" | grep -vE '^$|^#' | cut -d':' -f1 | sort -u) ) +tags=( $(curl -sSL "$url" | grep -vE '^$|^#' | cut -d':' -f1 | sort -u) ) unset IFS text= @@ -23,9 +24,19 @@ for tag in "${tags[@]}"; do fi done if [ "$text" ]; then + latest=($(curl -sSL "$url" | grep "latest.*github.com" | sed -e 's!git://github.com/!!' -e 's/@/ /' -)) + if [ -z "latest" ]; then + exit 0 # If not github or no latest tag, we are done here + fi + dockerfile='https://raw.githubusercontent.com/'"${latest[1]}"'/'"${latest[2]}"'/'"${latest[3]}"'/Dockerfile' + baseImage=$(curl -sSL $dockerfile | sed 's/:/\t/' | awk '$1 == "FROM" { print $2 }') # give a little space echo echo - cat "$dir/variant.md" + if [ "$baseImage" = "buildpack-deps" ]; then + cat "$dir/variant-buildpacks.md" + else + cat "$dir/variant.md" + fi echo "$text" fi diff --git a/django/README.md b/django/README.md index ca70dfc5..4e32a3c4 100644 --- a/django/README.md +++ b/django/README.md @@ -54,11 +54,11 @@ The `django` images come in many flavors, each designed for a specific use case. ## `django:` -This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of [`buildpack-deps`](https://registry.hub.docker.com/_/buildpack-deps/). `buildpack-deps` is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system. +This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. ## `django:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM django:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM django:onbuild` will be enough to create a stand-alone image for your project. # License diff --git a/golang/README.md b/golang/README.md index 809ed292..9bf4c2e9 100644 --- a/golang/README.md +++ b/golang/README.md @@ -72,7 +72,7 @@ This is the defacto image. If you are unsure about what your needs are, you prob ## `golang:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM golang:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM golang:onbuild` will be enough to create a stand-alone image for your project. # License diff --git a/iojs/README.md b/iojs/README.md index d9d5d275..12f4716f 100644 --- a/iojs/README.md +++ b/iojs/README.md @@ -47,7 +47,7 @@ This is the defacto image. If you are unsure about what your needs are, you prob ## `iojs:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM iojs:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM iojs:onbuild` will be enough to create a stand-alone image for your project. ## `iojs:slim` diff --git a/maven/README.md b/maven/README.md index fd344251..bbe9da49 100644 --- a/maven/README.md +++ b/maven/README.md @@ -43,11 +43,11 @@ The `maven` images come in many flavors, each designed for a specific use case. ## `maven:` -This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of [`buildpack-deps`](https://registry.hub.docker.com/_/buildpack-deps/). `buildpack-deps` is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system. +This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. ## `maven:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM maven:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM maven:onbuild` will be enough to create a stand-alone image for your project. # License diff --git a/mono/README.md b/mono/README.md index 54e17e56..fcb9608a 100644 --- a/mono/README.md +++ b/mono/README.md @@ -52,11 +52,11 @@ The `mono` images come in many flavors, each designed for a specific use case. ## `mono:` -This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of [`buildpack-deps`](https://registry.hub.docker.com/_/buildpack-deps/). `buildpack-deps` is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system. +This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. ## `mono:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM mono:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM mono:onbuild` will be enough to create a stand-alone image for your project. # License diff --git a/node/README.md b/node/README.md index aa5bcd3c..8d5a058d 100644 --- a/node/README.md +++ b/node/README.md @@ -60,7 +60,7 @@ This is the defacto image. If you are unsure about what your needs are, you prob ## `node:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM node:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM node:onbuild` will be enough to create a stand-alone image for your project. ## `node:slim` diff --git a/pypy/README.md b/pypy/README.md index 639e21b9..f9f03ad6 100644 --- a/pypy/README.md +++ b/pypy/README.md @@ -58,7 +58,7 @@ This is the defacto image. If you are unsure about what your needs are, you prob ## `pypy:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM pypy:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM pypy:onbuild` will be enough to create a stand-alone image for your project. ## `pypy:slim` diff --git a/rails/README.md b/rails/README.md index 3055e926..1f27eea5 100644 --- a/rails/README.md +++ b/rails/README.md @@ -55,11 +55,11 @@ The `rails` images come in many flavors, each designed for a specific use case. ## `rails:` -This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. This tag is based off of [`buildpack-deps`](https://registry.hub.docker.com/_/buildpack-deps/). `buildpack-deps` is designed for the average user of docker who has many images on their system. It, by design, has a large number of extremely common Debian packages. This reduces the number of packages that images that derive from it need to install, thus reducing the overall size of all images on your system. +This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of. ## `rails:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM rails:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM rails:onbuild` will be enough to create a stand-alone image for your project. # License diff --git a/ruby/README.md b/ruby/README.md index 19eb1619..20186ace 100644 --- a/ruby/README.md +++ b/ruby/README.md @@ -66,7 +66,7 @@ This is the defacto image. If you are unsure about what your needs are, you prob ## `ruby:onbuild` -This image makes building derivitative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM ruby:onbuild` will be enough to create a stand-alone image for your project. +This image makes building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM ruby:onbuild` will be enough to create a stand-alone image for your project. ## `ruby:slim`