Skip to content

Commit

Permalink
Add basic Alpine glibc detection
Browse files Browse the repository at this point in the history
  • Loading branch information
tianon committed Aug 26, 2021
1 parent 34de01f commit d882224
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dockerfile-validator
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ fi

# TODO catch "curl" without "-f" / "--fail"

if alpineGlibc="$(grep 'alpine-pkg-glibc' <<<"$df")" && [ -n "$alpineGlibc" ]; then
oh_no_context 'use of alpine-pkg-glibc is HIGHLY discouraged, as the results can be very unstable' \
'https://ariadne.space/2021/08/26/there-is-no-such-thing-as-a-glibc-based-alpine-image/' \
'https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/24647' \
'--' '' "$alpineGlibc"
fi
# TODO detect mixing of Alpine edge and a release, for example

adds="$(_filter 'ADD')"
# https://github.com/moby/moby/blob/740349757396d8f1ad573d4b78148baca9c979aa/pkg/urlutil/urlutil.go#L12 (valid prefixes for ADD <url>)
if urls="$(grep -E '^(--[^[:space:]]*[[:space:]]+)*https?://' <<<"$adds")" && [ -n "$urls" ]; then
Expand Down

0 comments on commit d882224

Please sign in to comment.