Skip to content

Commit

Permalink
Add Alpine support
Browse files Browse the repository at this point in the history
  • Loading branch information
agrrh committed Feb 17, 2018
1 parent 70a1d2d commit 62546d7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/strip-docker-image-export
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ function parse_commandline() {
}

function print_file() {
if [ "$1" = "/usr/bin/ldd" ]; then
exit
fi

if [ -e "$1" ] ; then
echo "$1"
else
Expand Down Expand Up @@ -138,10 +142,15 @@ function list_dependencies() {
}

function list_packages() {
if command -v /usr/bin/dpkg -L $1 >/dev/null 2>&1; then
if test -e /usr/bin/dpkg; then
DEPS=$(/usr/bin/dpkg -L $1)
else
elif test -e /usr/bin/rpm; then
DEPS=$(/usr/bin/rpm -ql $1)
elif test -e /sbin/apk; then
DEPS=$(/sbin/apk info -L $1 | grep -Ev '^$|contains:' | sed 's/^/\//g')
else
echo 'WARN: Unknown OS, aborted list_packages()'
exit
fi
while read FILE ; do
if [ ! -d "$FILE" ] ; then
Expand Down

0 comments on commit 62546d7

Please sign in to comment.