Skip to content

Commit

Permalink
Merge pull request docker-library#994 from infosiftr/fix-variant-dete…
Browse files Browse the repository at this point in the history
…ction

Fix variant detection for tags like "1.8-onbuild"
  • Loading branch information
yosifkit authored Sep 5, 2017
2 parents 6b6b3f3 + 4ee7a17 commit 9b90558
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
20 changes: 16 additions & 4 deletions .template-helpers/variant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,24 @@ tags=( $(bashbrew cat -f '
unset IFS

text=
declare -A includedFiles=()
for tag in "${tags[@]}"; do
for f in "$repoDir/variant-$tag.md" "$dir/variant-$tag.md"; do
for f in \
"$repoDir/variant-$tag.md" "$repoDir/variant-${tag##*-}.md" \
"$dir/variant-$tag.md" "$dir/variant-${tag##*-}.md" \
; do
if [ -n "${includedFiles[$f]}" ]; then
# make sure we don't duplicate variant sections
break
fi
if [ -f "$f" ]; then
text+=$'\n' # give a little space
text+="$(< "$f")"
text+=$'\n' # parameter expansion eats the trailing newline
includedFiles[$f]=1
if [ -s "$f" ]; then
# an empty file can be used to disable a specific "variant" section for an image
text+=$'\n' # give a little space
text+="$(< "$f")"
text+=$'\n' # parameter expansion eats the trailing newline
fi
break
fi
done
Expand Down
2 changes: 1 addition & 1 deletion .travis/check-markdownfmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ files="$(
find \( \
-name '*.md' \
-not -name 'README.md' \
\) -print0 \
\) -exec test -s '{}' ';' -print0 \
| xargs -0 markdownfmt -l)"
if [ "$files" ]; then
echo >&2 'Need markdownfmt:'
Expand Down
6 changes: 0 additions & 6 deletions debian/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/*
ENV LANG en_US.utf8
```

## `<suite>-slim` variants

These tags are an experiment in providing a slimmer base (removing some extra files that are normally not necessary within containers, such as man pages and documentation), and are definitely subject to change.

See the `debuerreotype-slimify` script (`debuerreotype` linked below) for more details about what gets removed during the "slimification" process.

## How It's Made

The rootfs tarballs for this image are built using [the reproducible-Debian-rootfs tool, `debuerreotype`](https://github.com/debuerreotype/debuerreotype), with an explicit goal being that they are transparent and reproducible. Using the same toolchain, it should be possible to regenerate (clean-room!) the same tarballs used for building the official Debian images.
Expand Down
5 changes: 5 additions & 0 deletions debian/variant-slim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## `%%IMAGE%%:<suite>-slim`

These tags are an experiment in providing a slimmer base (removing some extra files that are normally not necessary within containers, such as man pages and documentation), and are definitely subject to change.

See the `debuerreotype-slimify` script (`debuerreotype` linked above) for more details about what gets removed during the "slimification" process.
1 change: 1 addition & 0 deletions debian/variant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Image Variants
Empty file added oraclelinux/variant-slim.md
Empty file.
Empty file added traefik/variant-alpine.md
Empty file.

0 comments on commit 9b90558

Please sign in to comment.