docker-tools icon indicating copy to clipboard operation
docker-tools copied to clipboard

GenerateDockerfilesCommand fails when there isn't a previously generated Dockerfile

Open MichaelSimons opened this issue 4 years ago • 1 comments

Example failure:

System.IO.FileNotFoundException: Path specified in manifest file does not exist.
File name: 'src/aspnet/5.0/nanoserver-2004/amd64/Dockerfile'
   at Microsoft.DotNet.ImageBuilder.ViewModel.ModelExtensions.ValidateFileReference(String path, String manifestDirectory) in /image-builder/src/ViewModel/ModelExtensions.cs:line 98
   at Microsoft.DotNet.ImageBuilder.ViewModel.ModelExtensions.ValidateImage(Image image, String manifestDirectory) in /image-builder/src/ViewModel/ModelExtensions.cs:line 132
   at Microsoft.DotNet.ImageBuilder.ViewModel.ModelExtensions.ValidateRepo(Repo repo, String manifestDirectory) in /image-builder/src/ViewModel/ModelExtensions.cs:line 126
   at Microsoft.DotNet.ImageBuilder.ViewModel.ModelExtensions.Validate(Manifest manifest, String manifestDirectory) in /image-builder/src/ViewModel/ModelExtensions.cs:line 63
   at Microsoft.DotNet.ImageBuilder.ViewModel.ManifestInfo.Create(String manifestPath, ManifestFilter manifestFilter, IManifestOptionsInfo options) in /image-builder/src/ViewModel/ManifestInfo.cs:line 64
   at Microsoft.DotNet.ImageBuilder.ViewModel.ManifestInfo.Load(IManifestOptionsInfo options) in /image-builder/src/ViewModel/ManifestInfo.cs:line 45
   at Microsoft.DotNet.ImageBuilder.Commands.ManifestCommand`1.LoadManifest() in /image-builder/src/Commands/ManifestCommand.cs:line 16
   at Microsoft.DotNet.ImageBuilder.ImageBuilder.Main(String[] args) in /image-builder/src/ImageBuilder.cs:line 66

The manifest validation logic is getting in the way for this scenario. This logic runs when the manifest is loaded and validates that every path in the manifest exists. You should be able to use the GenerateDockerfilesCommand to generated the Dockerfiles instead of having to stub them out first.

MichaelSimons avatar Oct 12 '20 16:10 MichaelSimons

[Triage] Related: https://github.com/dotnet/dotnet-docker/issues/4704

lbussell avatar Aug 05 '24 18:08 lbussell