Hi, I am trying out Dagger for the first time. I have the following script which runs my library tests just fine:
import { connect } from "@dagger.io/dagger"
// Initialize Dagger client
connect(async (client) => {
// Use a rust container with the latest stable version to test the library
const libSource = client.container().from("rust:latest")
.withDirectory("/lib", client.host().directory("lib"), { exclude: ["target/**"] })
// Set the corking directory of the container to the lib directory
// run cargo test
const libOutput = await libSource.withWorkdir("/lib").withExec(["cargo", "test"]).stdout()
// print output
console.log(libOutput)
}, { LogOutput: process.stdout })
However whenever I run this I see a lot of data being copied
4: transferring /home/rolf/dev/pacosako/lib: 1.857GiB
Which I am quite sure is mostly the lib/target directory that I am trying to exclude. I have also tried excluding "target" or "target/" to no avail.
How do I properly exclude the target directory from being copied into my container?