Hi guys, having issues with docker build: `stat c...
# general
Hi guys, having issues with docker build:
stat cannot find Dockerfile: No such directory or folder
This is our code:
Copy code
export const myImage = new docker.Image(
        imageName: pulumi.interpolate`${region}-docker.pkg.dev/${artifactRegistry.project}/${artifactRegistry.repositoryId}/${myAppImageName}`,
        build: {
            args: imageArgs,
            platform: "linux/amd64",
            context: "../",
            dockerfile: "../Dockerfile.gcp_web",
    { dependsOn: [artifactRegistry, elastic.instance] }
Any ideas?
docker build .. -f ../Dockerfile.gcp_web
<---- this is working just fine in the same directory
What’s the directory structure? Can you tell us how those things are located in reference to each other: • Pulumi.yaml • source file (the one containing the code snippet mentioned above) • Dockerfile How do you run pulumi CLI (from what directory) on the top of that?
if you’re on linux-like platform, try to run
in the command line 🙂
I’ve never used
package but I have a strange feeling that using
might be not allowed 🤔
or if it is, it might be an issue with “current working directory”, relative paths can be resolved based on: • Pulumi.yaml (project file) • current working directory in which you run
pulumi up
• the actual file containing the rel path
This is my structure: project/ -ops(Folder) -> here is the Pulumi.yaml --resources(Folder) -> here is the actual pulumi docker code --index.ts --Pulumi.yaml DockerFile -> the docker file we need tu build DockerFile is inside project root folder. We run
pulumi up
command inside
folder. So that’s why we are using
as context and
as it’s actually the relative path (one up from ops, where we run the command) we already tried with one more directory but it didn’t work. (Expecting to use resources as the current path from pulumi) We also logged the
and everything points to
folder, where we are standing.
can you try to move the Dockerfile to
folder, change the code accordingly and run
pulumi up
again to see if the error persists?
it’s possible that the package cannot move outside of the pulumi project dir (that’s just my blind guess, assuming you haven’t done any silly mistake)
let me try to quickly check sth in my machine
We found the issue, and it’s not related to the dockerfile (as the error says) It’s related to some dependency (elastic search) not being able to be resolved……. We are going to investigate further and upload an issue to pulumi github
Thanks a lot @prehistoric-activity-61023! party pizza
I feel like I did nothing to help you but I’m glad to hear you managed to find the root cause 🙂
please post here a link to the issue when you report it 🙏