sparse-intern-71089
03/29/2023, 11:02 AMmelodic-tomato-39005
03/29/2023, 3:35 PM/
instead of \\
? Forward-slashes work on Windows, too, and some tools expect thembetter-park-50917
03/30/2023, 6:11 AMvar apiImage = new Image("api-image", new()
{
Build = new DockerBuildArgs
{
Context = "..",
Dockerfile = "../myapp.api/Dockerfile",
Platform = "linux/amd64",
},
ImageName = repo.RepositoryUrl,
Registry = new RegistryArgs
{
Server = repo.RepositoryUrl,
Username = username,
Password = password
}
});
and got error
error: error hashing dockerfile "../myapp.api/Dockerfile": could not open file ../myapp.api/Dockerfile: open ..\..\myapp.api\Dockerfile: The system cannot find the path specified.
fresh-spring-82225
04/03/2023, 8:00 PMfresh-spring-82225
04/03/2023, 8:31 PMbuild: {
context: imageDir,
dockerfile: `${imageDir}\\Dockerfile`
}
fresh-spring-82225
04/03/2023, 8:34 PMbuild: {
context: imageDir
}
or
build: {
context: imageDir,
dockerfile: `${imageDir}/Dockerfile`
}
fresh-spring-82225
04/03/2023, 9:55 PMfresh-spring-82225
04/03/2023, 10:02 PMbuildImage
twice, in order to tag the image with both latest
and a hash. When I call buildImage
the 2nd time, fails with this error (where imageDir
is test-image
):
error: error hashing dockerfile "test-image/Dockerfile": could not open file test-image/Dockerfile: open test-image\test-image\Dockerfile: The system cannot find the path specified.
fresh-spring-82225
04/03/2023, 10:04 PMdockerfile:`${imageDir}\\Dockerfile`
fresh-spring-82225
04/03/2023, 10:06 PM${_imageDir_}/Dockerfile
it doesn't work on Windows -- it works fine on Mac OS.fresh-spring-82225
04/03/2023, 10:22 PMfresh-spring-82225
04/03/2023, 10:22 PMimageDir
to an absolute pathfresh-spring-82225
04/03/2023, 10:33 PM