From 68d50ba2f56da634d7f673910b57162b55a80c4c Mon Sep 17 00:00:00 2001 From: Andrew Scheller Date: Sun, 26 Mar 2017 23:19:40 +0100 Subject: [PATCH] chore: don't bother sending any build context to Docker (#1226) We don't actually use any build context, as we just mount the local directory as a volume anyway. Omitting it speeds up the container start-up time. This is an enhanced version of #1173 --- .dockerignore | 1 + .gitattributes | 1 + scripts/build/docker/run-command.sh | 4 +--- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +* diff --git a/.gitattributes b/.gitattributes index 6a82d403..0fc5b641 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,6 +7,7 @@ # Text files dictionary text Dockerfile* text +.dockerignore text .editorconfig text etcher text .git* text diff --git a/scripts/build/docker/run-command.sh b/scripts/build/docker/run-command.sh index b4a89ced..fdf9f677 100755 --- a/scripts/build/docker/run-command.sh +++ b/scripts/build/docker/run-command.sh @@ -65,11 +65,9 @@ fi IMAGE_ID="etcher-build-$ARGV_ARCHITECTURE" -cp "$ARGV_SOURCE_CODE_DIRECTORY/.gitignore" "$ARGV_SOURCE_CODE_DIRECTORY/.dockerignore" docker build -f "$DOCKERFILE" -t "$IMAGE_ID" "$ARGV_SOURCE_CODE_DIRECTORY" -rm -f "$ARGV_SOURCE_CODE_DIRECTORY/.dockerignore" -# Docker complaints with: ". includes invalid characters for a local +# Docker complains with: ". includes invalid characters for a local # volume name, only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed" otherwise if [ "$ARGV_SOURCE_CODE_DIRECTORY" == "." ] || [ "$ARGV_SOURCE_CODE_DIRECTORY" == "./" ]