Skip to content

Commit 70cf230

Browse files
author
jakubk
committed
add: file to prune dockerfiles
Use this file to prune Dockerfiles before getting their hash. - remove empty lines, comments, and timestamp
1 parent 2d15a1e commit 70cf230

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docker/prune_dockerfile.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
if [ -z "$1" ]; then
4+
echo "Usage: $(basename $0) <input_filepath>"
5+
exit 1
6+
fi
7+
8+
# Remove empty lines, comments, and timestamp.
9+
sed -e '/\s*#.*$/d' -e '/^\s*$/d' -e '/generation_timestamp/d' "$1"

0 commit comments

Comments
 (0)