Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docker): Fix failing end to end tests (#997)
<!-- Provide summary of changes --> With #980, we fixed an issue which occurred when there were multiple dockerfiles present in the build directory. However, this may have broken our end to end tests, because the call to Docker was formatted as the following: ```sh docker build -t <imageTag> path/to -f Dockerfile ``` This should be fine, but the end to end tests began to fail on Monday with the following output: ```bash addons flow when deploying svc svc deploy should succeed /github.com/aws/amazon-ecs-cli-v2/e2e/addons/addons_test.go:145 unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /github.com/aws/amazon-ecs-cli-v2/e2e/addons/Dockerfile: no such file or directory Error: build Dockerfile at ./hello/Dockerfile with tag gallopinggurdey: building image: exit status 1 ``` This indicates that although the Dockerfile path was set to `hello/Dockerfile`, Docker was looking for the file somewhere in the root directory of that path (.) and subsequently failing. This fix always sets the dockerfile path to be relative to the *root* of the docker build context, not the *leaf* of the build context. (previously we were parsing paths like `path/to/dockerfile` into `path/to` and `dockerfile`, assuming that the dockerfile would be searched for in `path/to`, not `path`. This was incorrect.) The new behavior is to call: ```sh docker build -t <imageTag> path/to -f path/to/dockerfile ``` <!-- Issue number, if available. E.g. "Fixes #31", "Addresses #42, 77" --> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
- Loading branch information