Using the js sdk. building uising my existing dockerfile
I passed secret to dockeBuild's secrets arg but in container /run exists but empty, doesn't include a secrets folder
however jsdoc claims that it should be mounted
/**
* Secrets to pass to the build.
*
* They will be mounted at /run/secrets/[secret-name].
*/
secrets?: Secret[];
here's is the part of my build script;
connect(
async daggerClient => {
const envFile = await readFile('.env');
const envFileSecret = daggerClient.setSecret('dotenv', envFile.toString());
// get reference to the project directory
const source = daggerClient
.host()
.directory('.', {
exclude: [
'node_modules/',
'ci/',
'npm-debug.log',
'README.md',
'.next',
'.git',
'.env',
'gcp-dagger-service-account.json',
],
})
.dockerBuild({
dockerfile: './apps/web/Dockerfile',
secrets: [envFileSecret], // They will be mounted at /run/secrets/[secret-name].
});
// publish container to Google Container Registry
const gcrContainerPublishResponse = await source.publish(
GCR_PUBLISH_ADDRESS
);
// print ref
console.log(`Published at: ${gcrContainerPublishResponse}`);