diff --git a/avm-transpiler/Dockerfile.dockerignore b/avm-transpiler/Dockerfile.dockerignore new file mode 100644 index 00000000000..cc6b2b4c0d4 --- /dev/null +++ b/avm-transpiler/Dockerfile.dockerignore @@ -0,0 +1,5 @@ +* +!noir +!avm-transpiler +**/target +**/node_modules diff --git a/build-system/scripts/create_dockerignore b/build-system/scripts/create_dockerignore index feade28a12f..9e0521668b1 100755 --- a/build-system/scripts/create_dockerignore +++ b/build-system/scripts/create_dockerignore @@ -11,6 +11,12 @@ DOCKERFILE=$(query_manifest dockerfile $REPOSITORY) cd $BUILD_DIR DOCKERIGNOREFILE=$DOCKERFILE.dockerignore + +# If there is a dockerignore file committed to git, use it. +if git ls-files --error-unmatch $DOCKERIGNOREFILE > /dev/null 2>&1; then + exit 0 +fi + echo '*' > $DOCKERIGNOREFILE (git ls-files; git ls-files --others --exclude-standard) | sort -u | sed 's/^/!/' >> $DOCKERIGNOREFILE -echo '**/Dockerfile*' >> $DOCKERIGNOREFILE \ No newline at end of file +echo '**/Dockerfile*' >> $DOCKERIGNOREFILE