From a8da9556812d6b033f92d782b0c6ce4cf9e5859e Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 11 May 2017 15:07:15 -0700 Subject: [PATCH 1/8] Start refactoring for some semblance of multiarch support --- update.sh | 88 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/update.sh b/update.sh index 0f0d50f72..6d73f6ec8 100755 --- a/update.sh +++ b/update.sh @@ -1,42 +1,46 @@ #!/bin/bash -set -eo pipefail +set -Eeuo pipefail cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" helperDir='.template-helpers' -repos=( "$@" ) -if [ ${#repos[@]} -eq 0 ]; then - repos=( */ ) +images=( "$@" ) +if [ ${#images[@]} -eq 0 ]; then + images=( */ ) fi -repos=( "${repos[@]%/}" ) +images=( "${images[@]%/}" ) replace_field() { - repo="$1" + targetFile="$1" field="$2" content="$3" extraSed="${4:-}" sed_escaped_value="$(echo "$content" | sed 's/[\/&]/\\&/g')" sed_escaped_value="${sed_escaped_value//$'\n'/\\n}" - sed -ri "s/${extraSed}%%${field}%%${extraSed}/$sed_escaped_value/g" "$repo/README.md" + sed -ri -e "s/${extraSed}%%${field}%%${extraSed}/$sed_escaped_value/g" "$targetFile" } -for repo in "${repos[@]}"; do +for image in "${images[@]}"; do + repo="${image##*/}" + namespace="${image%$repo}" + namespace="${namespace%/}" + if [ -x "$repo/update.sh" ]; then ( set -x; "$repo/update.sh" ) fi - + if [ -e "$repo/content.md" ]; then githubRepo="$(cat "$repo/github-repo")" maintainer="$(cat "$repo/maintainer.md")" - + issues="$(cat "$repo/issues.md" 2>/dev/null || cat "$helperDir/issues.md")" getHelp="$(cat "$repo/get-help.md" 2>/dev/null || cat "$helperDir/get-help.md")" - + license="$(cat "$repo/license.md" 2>/dev/null || true)" if [ "$license" ]; then license=$'\n\n''# License'$'\n\n'"$license" fi - + logo= logoFile= for f in png svg; do @@ -54,67 +58,69 @@ for repo in "${repos[@]}"; do logo="![logo](https://raw.githubusercontent.com/docker-library/docs/$logoCommit/$logoFile)" fi fi - + compose= composeYml= if [ -f "$repo/docker-compose.yml" ]; then compose="$(cat "$repo/compose.md" 2>/dev/null || cat "$helperDir/compose.md")" composeYml=$'```yaml\n'"$(cat "$repo/docker-compose.yml")"$'\n```' fi - + deprecated= if [ -f "$repo/deprecated.md" ]; then deprecated=$'# **DEPRECATED**\n\n' deprecated+="$(cat "$repo/deprecated.md")" deprecated+=$'\n\n' fi - + + targetFile="$repo/README.md" + { cat "$helperDir/autogenerated-warning.md" echo echo -n "$deprecated" cat "$helperDir/template.md" - } > "$repo/README.md" - + } > "$targetFile" + echo ' TAGS => generate-dockerfile-links-partial.sh "'"$repo"'"' partial="$("$helperDir/generate-dockerfile-links-partial.sh" "$repo")" [ "$partial" ] - replace_field "$repo" 'TAGS' "$partial" - + replace_field "$targetFile" 'TAGS' "$partial" + echo ' CONTENT => '"$repo"'/content.md' - replace_field "$repo" 'CONTENT' "$(cat "$repo/content.md")" - + replace_field "$targetFile" 'CONTENT' "$(cat "$repo/content.md")" + echo ' VARIANT => variant.sh' - replace_field "$repo" 'VARIANT' "$("$helperDir/variant.sh" "$repo")" - + replace_field "$targetFile" 'VARIANT' "$("$helperDir/variant.sh" "$repo")" + # has to be after CONTENT because it's contained in content.md echo " LOGO => $logo" - replace_field "$repo" 'LOGO' "$logo" '\s*' - + replace_field "$targetFile" 'LOGO' "$logo" '\s*' + echo ' COMPOSE => '"$repo"'/compose.md' - replace_field "$repo" 'COMPOSE' "$compose" - + replace_field "$targetFile" 'COMPOSE' "$compose" + echo ' COMPOSE-YML => '"$repo"'/docker-compose.yml' - replace_field "$repo" 'COMPOSE-YML' "$composeYml" - + replace_field "$targetFile" 'COMPOSE-YML' "$composeYml" + echo ' LICENSE => '"$repo"'/license.md' - replace_field "$repo" 'LICENSE' "$license" - + replace_field "$targetFile" 'LICENSE' "$license" + echo ' ISSUES => "'"$issues"'"' - replace_field "$repo" 'ISSUES' "$issues" - + replace_field "$targetFile" 'ISSUES' "$issues" + echo ' GET-HELP => "'"$getHelp"'"' - replace_field "$repo" 'GET-HELP' "$getHelp" - + replace_field "$targetFile" 'GET-HELP' "$getHelp" + echo ' MAINTAINER => "'"$maintainer"'"' - replace_field "$repo" 'MAINTAINER' "$maintainer" - + replace_field "$targetFile" 'MAINTAINER' "$maintainer" + echo ' REPO => "'"$repo"'"' - replace_field "$repo" 'REPO' "$repo" - + replace_field "$targetFile" 'REPO' "$repo" + echo ' GITHUB-REPO => "'"$githubRepo"'"' - replace_field "$repo" 'GITHUB-REPO' "$githubRepo" - + replace_field "$targetFile" 'GITHUB-REPO' "$githubRepo" + echo else echo >&2 "skipping $repo: missing repo/content.md" From 88f4c65633167b56dc71185a2bb40c1d39d4f619 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 11 May 2017 15:21:18 -0700 Subject: [PATCH 2/8] Add "%%IMAGE%%" and use it in HAProxy --- haproxy/content.md | 12 ++++++------ update.sh | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/haproxy/content.md b/haproxy/content.md index 5c18954c1..906ad1b2a 100644 --- a/haproxy/content.md +++ b/haproxy/content.md @@ -14,12 +14,12 @@ Please refer to [upstream's excellent (and comprehensive) documentation](https:/ It is also worth checking out the [`examples/` directory from upstream](http://www.haproxy.org/git?p=haproxy-1.7.git;a=tree;f=examples). -Note: Many configuration examples propose to put `daemon` into the `global` section to run haproxy as daemon. Do **not** configure this or the Docker container will exit immediately after launching because the haproxy process would go into the background. +Note: Many configuration examples propose to put `daemon` into the `global` section to run HAProxy as daemon. Do **not** configure this or the Docker container will exit immediately after launching because the HAProxy process would go into the background. ## Create a `Dockerfile` ```dockerfile -FROM haproxy:1.7 +FROM %%IMAGE%%:1.7 COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg ``` @@ -41,22 +41,22 @@ $ docker run -it --rm --name haproxy-syntax-check my-haproxy haproxy -c -f /usr/ $ docker run -d --name my-running-haproxy my-haproxy ``` -You may need to publish the ports your haproxy is listening on to the host by specifying the -p option, for example -p 8080:80 to publish port 8080 from the container host to port 80 in the container. Make sure the port you're using is free. +You may need to publish the ports your HAProxy is listening on to the host by specifying the -p option, for example -p 8080:80 to publish port 8080 from the container host to port 80 in the container. Make sure the port you're using is free. ## Directly via bind mount ```console -$ docker run -d --name my-running-haproxy -v /path/to/etc/haproxy:/usr/local/etc/haproxy:ro haproxy:1.7 +$ docker run -d --name my-running-haproxy -v /path/to/etc/haproxy:/usr/local/etc/haproxy:ro %%IMAGE%%:1.7 ``` Note that your host's `/path/to/etc/haproxy` folder should be populated with a file named `haproxy.cfg`. If this configuration file refers to any other files within that folder then you should ensure that they also exist (e.g. template files such as `400.http`, `404.http`, and so forth). However, many minimal configurations do not require any supporting files. ### Reloading config -If you used a bind mount for the config and have edited your `haproxy.cfg` file, you can use haproxy's graceful reload feature by sending a `SIGHUP` to the container: +If you used a bind mount for the config and have edited your `haproxy.cfg` file, you can use HAProxy's graceful reload feature by sending a `SIGHUP` to the container: ```console $ docker kill -s HUP my-running-haproxy ``` -The entrypoint script in the image checks for running the command `haproxy` and replaces it with `haproxy-systemd-wrapper` from haproxy upstream which takes care of signal handling to do the graceful reload. Under the hood this uses the `-sf` option of haproxy so "there are two small windows of a few milliseconds each where it is possible that a few connection failures will be noticed during high loads" (see [Stopping and restarting HAProxy](http://www.haproxy.org/download/1.7/doc/management.txt)). +The entrypoint script in the image checks for running the command `haproxy` and replaces it with `haproxy-systemd-wrapper` from HAProxy upstream which takes care of signal handling to do the graceful reload. Under the hood this uses the `-sf` option of `haproxy` so "there are two small windows of a few milliseconds each where it is possible that a few connection failures will be noticed during high loads" (see [Stopping and restarting HAProxy](http://www.haproxy.org/download/1.7/doc/management.txt)). diff --git a/update.sh b/update.sh index 6d73f6ec8..f2bf48614 100755 --- a/update.sh +++ b/update.sh @@ -115,6 +115,9 @@ for image in "${images[@]}"; do echo ' MAINTAINER => "'"$maintainer"'"' replace_field "$targetFile" 'MAINTAINER' "$maintainer" + echo ' IMAGE => "'"$image"'"' + replace_field "$targetFile" 'IMAGE' "$image" + echo ' REPO => "'"$repo"'"' replace_field "$targetFile" 'REPO' "$repo" From e5c86c32de6098ad3cf8b5de9f334ea120c06d6b Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 11 May 2017 15:25:21 -0700 Subject: [PATCH 3/8] Update python to use %%IMAGE%% (and unroll onbuild examples) --- python/content.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/python/content.md b/python/content.md index eccf26948..512f4099e 100644 --- a/python/content.md +++ b/python/content.md @@ -11,19 +11,33 @@ Python is an interpreted, interactive, object-oriented, open-source programming ## Create a `Dockerfile` in your Python app project ```dockerfile -FROM python:3-onbuild +FROM %%IMAGE%%:3 + +WORKDIR /usr/src/app + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + CMD [ "python", "./your-daemon-or-script.py" ] ``` or (if you need to use Python 2): ```dockerfile -FROM python:2-onbuild +FROM %%IMAGE%%:2 + +WORKDIR /usr/src/app + +COPY requirements.txt ./ +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + CMD [ "python", "./your-daemon-or-script.py" ] ``` -These images include multiple `ONBUILD` triggers, which should be all you need to bootstrap most applications. The build will `COPY` a `requirements.txt` file, `RUN pip install` on said file, and then copy the current directory into `/usr/src/app`. - You can then build and run the Docker image: ```console @@ -36,11 +50,11 @@ $ docker run -it --rm --name my-running-app my-python-app For many simple, single file projects, you may find it inconvenient to write a complete `Dockerfile`. In such cases, you can run a Python script by using the Python Docker image directly: ```console -$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python your-daemon-or-script.py +$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:3 python your-daemon-or-script.py ``` or (again, if you need to use Python 2): ```console -$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:2 python your-daemon-or-script.py +$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:2 python your-daemon-or-script.py ``` From 3bbc4f0c0fbcbb148ff563c9ff55e9531ef1f0d1 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 11 May 2017 15:28:06 -0700 Subject: [PATCH 4/8] Update busybox to use %%IMAGE%% --- busybox/content.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/busybox/content.md b/busybox/content.md index c837d1942..66e9c792c 100644 --- a/busybox/content.md +++ b/busybox/content.md @@ -13,7 +13,7 @@ BusyBox combines tiny versions of many common UNIX utilities into a single small ## Run BusyBox shell ```console -$ docker run -it --rm busybox +$ docker run -it --rm %%IMAGE%% ``` This will drop you into an `sh` shell to allow you to do what you want inside a BusyBox system. @@ -21,7 +21,7 @@ This will drop you into an `sh` shell to allow you to do what you want inside a ## Create a `Dockerfile` for a binary ```dockerfile -FROM busybox +FROM %%IMAGE%% COPY ./my-static-binary /my-static-binary CMD ["/my-static-binary"] ``` @@ -32,8 +32,8 @@ This `Dockerfile` will allow you to create a minimal image for your statically c This image contains BusyBox built against various "libc" variants (for a comparison of "libc" variants, [Eta Labs has a very nice chart](http://www.etalabs.net/compare_libcs.html) which lists many similarities and differences). -- `busybox:glibc`: [glibc from Debian](https://packages.debian.org/jessie/libc6) (which is then included in the image) -- `busybox:musl`: [musl from Alpine](https://pkgs.alpinelinux.org/package/main/x86_64/musl) (statically compiled) -- `busybox:uclibc`: [uClibc](https://uclibc.org) via [Buildroot](https://buildroot.org) (statically compiled) +- `%%IMAGE%%:glibc`: [glibc from Debian](https://packages.debian.org/jessie/libc6) (which is then included in the image) +- `%%IMAGE%%:musl`: [musl from Alpine](https://pkgs.alpinelinux.org/package/main/x86_64/musl) (statically compiled) +- `%%IMAGE%%:uclibc`: [uClibc](https://uclibc.org) via [Buildroot](https://buildroot.org) (statically compiled) For more information about the specific particulars of the build process for each variant, see `Dockerfile.builder` in the same directory as each variant's `Dockerfile` (see links above). From de49192681749a5e3a599bd5d90fc41e6264b5f2 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 11 May 2017 15:32:29 -0700 Subject: [PATCH 5/8] Adjust ".template-helpers/generate-dockerfile-links-partial.sh" to allow for the local library to take precedence over explicit master (if we set BASHBREW_LIBRARY like Jenkins does) --- .../generate-dockerfile-links-partial.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.template-helpers/generate-dockerfile-links-partial.sh b/.template-helpers/generate-dockerfile-links-partial.sh index 13affbc2d..5c0b595ec 100755 --- a/.template-helpers/generate-dockerfile-links-partial.sh +++ b/.template-helpers/generate-dockerfile-links-partial.sh @@ -1,13 +1,18 @@ #!/bin/bash -set -e +set -Eeuo pipefail -repo="$1" +repo="${1:-}" if [ -z "$repo" ]; then echo >&2 "usage: $0 repo" echo >&2 " ie: $0 hylang" exit 1 fi +# if we haven't set BASHBREW_LIBRARY explicitly (like Jenkins does, for example), don't trust the local library +if [ -z "${BASHBREW_LIBRARY:-}" ]; then + repo="https://github.com/docker-library/official-images/raw/master/library/$repo" +fi + bashbrew cat \ -F "$(dirname "$BASH_SOURCE")/$(basename "$BASH_SOURCE" .sh).tmpl" \ - "https://github.com/docker-library/official-images/raw/master/library/$repo" + "$repo" From 9be18fd84310aead63516d2811a1e93a0b4d3321 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 11 May 2017 15:43:39 -0700 Subject: [PATCH 6/8] Update variant helpers with the same logic as the tags helper --- .template-helpers/variant-alpine.md | 2 +- .template-helpers/variant-buildpacks.md | 4 ++-- .template-helpers/variant-onbuild.md | 4 ++-- .template-helpers/variant-slim.md | 4 ++-- .template-helpers/variant-windowsservercore.md | 2 +- .template-helpers/variant.md | 4 ++-- .template-helpers/variant.sh | 10 +++++++--- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.template-helpers/variant-alpine.md b/.template-helpers/variant-alpine.md index 75a089d54..a7f402d92 100644 --- a/.template-helpers/variant-alpine.md +++ b/.template-helpers/variant-alpine.md @@ -1,4 +1,4 @@ -## `%%REPO%%:alpine` +## `%%IMAGE%%:alpine` This image is based on the popular [Alpine Linux project](http://alpinelinux.org), available in [the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general. diff --git a/.template-helpers/variant-buildpacks.md b/.template-helpers/variant-buildpacks.md index 554a78c42..0189e7f6c 100644 --- a/.template-helpers/variant-buildpacks.md +++ b/.template-helpers/variant-buildpacks.md @@ -1,7 +1,7 @@ # Image Variants -The `%%REPO%%` images come in many flavors, each designed for a specific use case. +The `%%IMAGE%%` images come in many flavors, each designed for a specific use case. -## `%%REPO%%:` +## `%%IMAGE%%:` 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-onbuild.md b/.template-helpers/variant-onbuild.md index 32d39b0cb..3711b19c1 100644 --- a/.template-helpers/variant-onbuild.md +++ b/.template-helpers/variant-onbuild.md @@ -1,6 +1,6 @@ -## `%%REPO%%:onbuild` +## `%%IMAGE%%:onbuild` -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 %%REPO%%: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 %%IMAGE%%:onbuild` will be enough to create a stand-alone image for your project. While the `onbuild` variant is really useful for "getting off the ground running" (zero to Dockerized in a short period of time), it's not recommended for long-term usage within a project due to the lack of control over *when* the `ONBUILD` triggers fire (see also [`docker/docker#5714`](https://github.com/docker/docker/issues/5714), [`docker/docker#8240`](https://github.com/docker/docker/issues/8240), [`docker/docker#11917`](https://github.com/docker/docker/issues/11917)). diff --git a/.template-helpers/variant-slim.md b/.template-helpers/variant-slim.md index d5744ac0f..8c9dd03a2 100644 --- a/.template-helpers/variant-slim.md +++ b/.template-helpers/variant-slim.md @@ -1,3 +1,3 @@ -## `%%REPO%%:slim` +## `%%IMAGE%%:slim` -This image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run `%%REPO%%`. Unless you are working in an environment where *only* the %%REPO%% image will be deployed and you have space constraints, we highly recommend using the default image of this repository. +This image does not contain the common packages contained in the default tag and only contains the minimal packages needed to run `%%IMAGE%%`. Unless you are working in an environment where *only* the `%%IMAGE%%` image will be deployed and you have space constraints, we highly recommend using the default image of this repository. diff --git a/.template-helpers/variant-windowsservercore.md b/.template-helpers/variant-windowsservercore.md index 8676256b2..189c59897 100644 --- a/.template-helpers/variant-windowsservercore.md +++ b/.template-helpers/variant-windowsservercore.md @@ -1,4 +1,4 @@ -## `%%REPO%%:windowsservercore` +## `%%IMAGE%%:windowsservercore` This image is based on [Windows Server Core (`microsoft/windowsservercore`)](https://hub.docker.com/r/microsoft/windowsservercore/). As such, it only works in places which that image does, such as Windows 10 Professional/Enterprise (Anniversary Edition) or Windows Server 2016. diff --git a/.template-helpers/variant.md b/.template-helpers/variant.md index efcccf49c..822c82dc2 100644 --- a/.template-helpers/variant.md +++ b/.template-helpers/variant.md @@ -1,7 +1,7 @@ # Image Variants -The `%%REPO%%` images come in many flavors, each designed for a specific use case. +The `%%IMAGE%%` images come in many flavors, each designed for a specific use case. -## `%%REPO%%:` +## `%%IMAGE%%:` 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 2dad993e9..cae45322f 100755 --- a/.template-helpers/variant.sh +++ b/.template-helpers/variant.sh @@ -10,10 +10,14 @@ fi dir="$(dirname "$(readlink -f "$BASH_SOURCE")")" repoDir="$dir/../$repo" -url='https://raw.githubusercontent.com/docker-library/official-images/master/library/'"$repo" + +# if we haven't set BASHBREW_LIBRARY explicitly (like Jenkins does, for example), don't trust the local library +if [ -z "${BASHBREW_LIBRARY:-}" ]; then + repo="https://github.com/docker-library/official-images/raw/master/library/$repo" +fi IFS=$'\n' -tags=( $(bashbrew cat -f '{{ range .Entries }}{{ join "\n" .Tags }}{{ "\n" }}{{ end }}' "$url") ) +tags=( $(bashbrew cat -f '{{ range .Entries }}{{ join "\n" .Tags }}{{ "\n" }}{{ end }}' "$repo") ) unset IFS text= @@ -29,7 +33,7 @@ for tag in "${tags[@]}"; do done if [ "$text" ]; then - baseImage="$(bashbrew cat -f '{{ .DockerFrom .TagEntry }}' "$url":latest)" + baseImage="$(bashbrew cat -f '{{ .DockerFrom .TagEntry }}' "$repo":latest)" baseImage="${baseImage%:*}" echo From c379f5d6c81c3fe82fe2e290d24d446fbcce260f Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 11 May 2017 15:47:20 -0700 Subject: [PATCH 7/8] Update python/variant-onbuild.md --- python/variant-onbuild.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/variant-onbuild.md b/python/variant-onbuild.md index 0c42dab9c..79647d39a 100644 --- a/python/variant-onbuild.md +++ b/python/variant-onbuild.md @@ -1,6 +1,6 @@ -## `%%REPO%%:onbuild` +## `%%IMAGE%%:onbuild` -This image feeds your `requirements.txt` file automatically to `pip` in order to make building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM %%REPO%%:onbuild` will be enough to create a stand-alone image for your project. +This image feeds your `requirements.txt` file automatically to `pip` in order to make building derivative images easier. For most use cases, creating a `Dockerfile` in the base of your project directory with the line `FROM %%IMAGE%%:onbuild` will be enough to create a stand-alone image for your project. While the `onbuild` variant is really useful for "getting off the ground running" (zero to Dockerized in a short period of time), it's not recommended for long-term usage within a project due to the lack of control over *when* the `ONBUILD` triggers fire (see also [`docker/docker#5714`](https://github.com/docker/docker/issues/5714), [`docker/docker#8240`](https://github.com/docker/docker/issues/8240), [`docker/docker#11917`](https://github.com/docker/docker/issues/11917)). From 40fa99fdab099b08f354de5ce97d25e2055f52be Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 12 May 2017 08:57:00 -0700 Subject: [PATCH 8/8] Update busybox URLs, and refactor variant handling to use explicit "variant-xxx.md" files --- busybox/content.md | 10 ---------- busybox/variant-glibc.md | 3 +++ busybox/variant-musl.md | 3 +++ busybox/variant-uclibc.md | 3 +++ busybox/variant.md | 5 +++++ 5 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 busybox/variant-glibc.md create mode 100644 busybox/variant-musl.md create mode 100644 busybox/variant-uclibc.md create mode 100644 busybox/variant.md diff --git a/busybox/content.md b/busybox/content.md index 66e9c792c..1b1b8766a 100644 --- a/busybox/content.md +++ b/busybox/content.md @@ -27,13 +27,3 @@ CMD ["/my-static-binary"] ``` This `Dockerfile` will allow you to create a minimal image for your statically compiled binary. You will have to compile the binary in some other place like another container. For a simpler alternative that's similarly tiny but easier to extend, [see `alpine`](https://hub.docker.com/_/alpine/). - -## Image Variants - -This image contains BusyBox built against various "libc" variants (for a comparison of "libc" variants, [Eta Labs has a very nice chart](http://www.etalabs.net/compare_libcs.html) which lists many similarities and differences). - -- `%%IMAGE%%:glibc`: [glibc from Debian](https://packages.debian.org/jessie/libc6) (which is then included in the image) -- `%%IMAGE%%:musl`: [musl from Alpine](https://pkgs.alpinelinux.org/package/main/x86_64/musl) (statically compiled) -- `%%IMAGE%%:uclibc`: [uClibc](https://uclibc.org) via [Buildroot](https://buildroot.org) (statically compiled) - -For more information about the specific particulars of the build process for each variant, see `Dockerfile.builder` in the same directory as each variant's `Dockerfile` (see links above). diff --git a/busybox/variant-glibc.md b/busybox/variant-glibc.md new file mode 100644 index 000000000..0fad085bd --- /dev/null +++ b/busybox/variant-glibc.md @@ -0,0 +1,3 @@ +## `%%IMAGE%%:glibc` + +- [glibc from Debian](https://packages.debian.org/search?searchon=names&exact=1&suite=all§ion=all&keywords=libc6) (which is then included in the image) diff --git a/busybox/variant-musl.md b/busybox/variant-musl.md new file mode 100644 index 000000000..75d719c25 --- /dev/null +++ b/busybox/variant-musl.md @@ -0,0 +1,3 @@ +## `%%IMAGE%%:musl` + +- [musl from Alpine](https://pkgs.alpinelinux.org/packages?name=musl) (statically compiled) diff --git a/busybox/variant-uclibc.md b/busybox/variant-uclibc.md new file mode 100644 index 000000000..139b58f65 --- /dev/null +++ b/busybox/variant-uclibc.md @@ -0,0 +1,3 @@ +## `%%IMAGE%%:uclibc` + +- [uClibc](https://uclibc.org) via [Buildroot](https://buildroot.org) (statically compiled) diff --git a/busybox/variant.md b/busybox/variant.md new file mode 100644 index 000000000..46e3693d7 --- /dev/null +++ b/busybox/variant.md @@ -0,0 +1,5 @@ +# Image Variants + +The `%%IMAGE%%` images contain BusyBox built against various "libc" variants (for a comparison of "libc" variants, [Eta Labs has a very nice chart](http://www.etalabs.net/compare_libcs.html) which lists many similarities and differences). + +For more information about the specific particulars of the build process for each variant, see `Dockerfile.builder` in the same directory as each variant's `Dockerfile` (see links above).