Skip to content

Instantly share code, notes, and snippets.

@Masa-Shin
Masa-Shin / dockerignore-test.sh
Last active January 14, 2022 18:11 — forked from sgdan/dockerignore-test.sh
Test the ".dockerignore" file to ensure the build context doesn't contain unwanted files
#!/bin/sh
# Based on BMitch's answer from:
# https://stackoverflow.com/questions/38946683/how-to-test-dockerignore-file
# 1. .dockerignoreをチェックしたいプロジェクトに移動し、このファイルを配置します。
# 2. 実行結果を保存するファイルを指定して、これを実行します。例:'./dockerignore-test.sh file_list.txt'
# 3. 指定したファイルにコンテナ内のファイル一覧が保存されます。
if [ "$1" = "" ]; then