Skip to content

Commit

Permalink
Fix: .dockerignore files were written to the wrong directory
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus committed Nov 14, 2024
1 parent c478c6e commit 39bbbac
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Source/Bake/Cooking/Cooks/Docker/DockerBuildCook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@ protected override async Task<bool> CookAsync(
DockerBuildRecipe recipe,
CancellationToken cancellationToken)
{
var directoryPath = Path.GetDirectoryName(recipe.WorkingDirectory)!;
var dockerIgnoreFilePath = Path.Join(directoryPath, ".dockerignore");
var dockerIgnoreFilePath = Path.Join(recipe.WorkingDirectory, ".dockerignore");
if (!File.Exists(dockerIgnoreFilePath))
{
_logger.LogWarning(
"There is no '.dockerignore' file at {FilePath}, consider adding one! Bake will create one with some sensible defaults for you",
dockerIgnoreFilePath);
await _dockerIgnores.WriteAsync(
directoryPath,
recipe.WorkingDirectory,
cancellationToken);
}

Expand Down

0 comments on commit 39bbbac

Please sign in to comment.