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
This commit is contained in:
Andrew Scheller 2017-03-26 23:19:40 +01:00 committed by Juan Cruz Viotti
parent cbc9dfecf6
commit 68d50ba2f5
3 changed files with 3 additions and 3 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
*

1
.gitattributes vendored
View File

@ -7,6 +7,7 @@
# Text files # Text files
dictionary text dictionary text
Dockerfile* text Dockerfile* text
.dockerignore text
.editorconfig text .editorconfig text
etcher text etcher text
.git* text .git* text

View File

@ -65,11 +65,9 @@ fi
IMAGE_ID="etcher-build-$ARGV_ARCHITECTURE" 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" 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 # volume name, only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed" otherwise
if [ "$ARGV_SOURCE_CODE_DIRECTORY" == "." ] || if [ "$ARGV_SOURCE_CODE_DIRECTORY" == "." ] ||
[ "$ARGV_SOURCE_CODE_DIRECTORY" == "./" ] [ "$ARGV_SOURCE_CODE_DIRECTORY" == "./" ]