I have an <ASP.NET> application which has a Docker...
# dotnet
b
I have an ASP.NET application which has a Docker File and am trying to create the Docker Image using Pulumi. When I specify the Docker.ImageArgs, I can set the Build to the relative path of the directory where the Docker File is located. However, I need to pass the working directory to Docker. I am currently doing the following when using Docker build: docker build -f ./Dockerfile [/working_directory_path] When using Pulumi (C#), I am doing something like: var image = new Docker.Image("app-img", new Docker.ImageArgs { Build = "../path_to/directory_of_docker_file", ImageName = appRepo.RepositoryUrl, Registry = new Docker.ImageRegistry { Server = appRepo.RepositoryUrl, Username = appRepoCredentials.GetAt(0), Password = appRepoCredentials.GetAt(1) }, }); However I need to be able to specify the working directory for the docker file (in a similar way to when using docker build). Does anyone know how to achieve this with the C# API?
I managed to solve this one myself. For anyone else with the same issue, instead of using a string for Build which is set to the directory containing the Dockerfile, instead use the following:
Build = new Docker.DockerBuild() { Context = "../relative_path_of_directory_you_want_to_be_provided_to_the_dockerfile", Dockerfile = "../path_to_docker_directory/Dockerfile" }