From 0afae4f0425515985505674fa651f8568e8c923f Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 16 Feb 2024 13:56:49 +0100 Subject: [PATCH] don't include the .git directory in the context send to `docker build` without this `DNS_TEST_SUBJECT="hickory $URL" cargo t` was re-building hickory from scratch even when its source had not change not including the `.git` directory in the hickory repository lets Docker see that the source code has not changed --- packages/dns-test/src/container.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/dns-test/src/container.rs b/packages/dns-test/src/container.rs index f1ef2277..449f81d8 100644 --- a/packages/dns-test/src/container.rs +++ b/packages/dns-test/src/container.rs @@ -57,6 +57,9 @@ impl Container { exec_or_panic(&mut cp_r, false); } + fs::write(docker_build_dir.join(".dockerignore"), "src/.git") + .expect("could not create .dockerignore file"); + exec_or_panic(&mut command, verbose_docker_build()); });