Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use posix path for dockerfile path passed to docker build API #5528

Merged
merged 5 commits into from
Jul 21, 2023

Conversation

hnnasit
Copy link
Contributor

@hnnasit hnnasit commented Jul 14, 2023

Which issue(s) does this change fix?

#5345

Why is this change necessary?

When sam build is run for CDK projects on Windows for image-type functions with Dockerfile present in a nested directory, the command fails. Docker build API expects a posix path (with forward-slash) to be passed for dockerfile parameter but when sam build is run for CDK on Windows, Windows format path (with backslash) is passed causing build image to fail. Non-CDK projects currently passes posix path for dockerfile.

resource_metadata_normalizer.py is updated so that dockerfile path saved in build.toml is consistent with the value passed to docker API and with how non CDK templates saves this parameter.
app_builder.py is updated so that any new workflow calling build passes a posix path and does not break this behavior in Windows.

How does it address the issue?

Fixes the issue mentioned above

What side effects does this change have?

There should not be any side effects. Integration tests have been added to test the new behavior.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hnnasit hnnasit changed the title fix: Use posix path for dockerfile path read from SAM Metadata fix: Use posix path for dockerfile path passed to docker build API Jul 17, 2023
@hnnasit hnnasit marked this pull request as ready for review July 17, 2023 20:57
@hnnasit hnnasit requested a review from a team as a code owner July 17, 2023 20:57
@hnnasit hnnasit added this pull request to the merge queue Jul 20, 2023
Merged via the queue into aws:develop with commit 46c374f Jul 21, 2023
75 checks passed
@hnnasit hnnasit deleted the sam-bug-5345 branch September 22, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants