Improve slimming checks and integration

Change-Id: I96f0c6814e27c2caebff6a0b5ddb8c5284b66c0a
diff --git a/slim_script.sh b/slim_script.sh
new file mode 100755
index 0000000..bc3dd0c
--- /dev/null
+++ b/slim_script.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Get the version from the parameter or
+# the latest git tag or "latest"
+VERSION="${1:-$(git describe --tags --abbrev=0 2>/dev/null || echo "latest")}"
+
+# Remove the leading 'v' if it exists
+VERSION=${VERSION#v}
+
+# Build the docker-slim command
+slim build --http-probe=true \
+           --exec="perl Makefile.PL && make test && unzip -v" \
+           --include-workdir=true \
+           --include-path="/usr/local/share/perl5/site_perl/KorAP/" \
+           --include-path="/usr/local/share/perl5/site_perl/Mojolicious/" \
+           --include-path="/usr/local/share/perl5/site_perl/Mojo/" \
+           --tag "korap/kalamar:$VERSION" \
+           --tag "korap/kalamar:latest" \
+           "korap/kalamar:${VERSION}-large"