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

Use the Dockerfile rel path against Copilot dir instead of pwd #1030

Closed
iamhopaul123 opened this issue Jun 15, 2020 · 3 comments
Closed

Use the Dockerfile rel path against Copilot dir instead of pwd #1030

iamhopaul123 opened this issue Jun 15, 2020 · 3 comments
Labels
type/bug Issues that are bugs.

Comments

@iamhopaul123
Copy link
Contributor

Now we default the Dockerfile path to be ./Dockerfile. As expected . should be the path for Copilot dir instead of pwd. However, if I have an app like this:

  • Copilot/
    • mySvc/
      • manifest.yml
  • Dockerfile
  • mySvc/
  • fluentbit/
    • Dockerfile

Then if I run svc deploy in fluentbit/, then Copilot will pick up the Dockerfile for fluentbit instead of the Dockerfile in the root dir, which can be considered as a bug.

@iamhopaul123 iamhopaul123 added the type/bug Issues that are bugs. label Jun 15, 2020
@efekarakus
Copy link
Contributor

Related #1059

@bvtujo
Copy link
Contributor

bvtujo commented Jun 29, 2020

Just to clarify, do you suggest that the path specified in the manifest for the top-level Dockerfile in your example should be ../Dockerfile and the fluentbit Dockerfile should be ../fluentbit/Dockerfile?

@iamhopaul123
Copy link
Contributor Author

iamhopaul123 commented Jun 29, 2020

ah no since the fluentbit dockerfile is just a sidecar. So far we don't do the upload for their sidecar image automatically. It's just i would expect svc deploy should always pick up the same dockerfile no matter which level i am at in my application folder. So maybe in the build field of the manifest we should make the location of dockerfile path to be relative to the workspace root instead of against pwd.

mergify bot pushed a commit that referenced this issue Aug 5, 2020
…ifest (#1059)

This PR adds the ability to specify [docker compose style build directives](https://docs.docker.com/compose/compose-file/#build) in the manifest. 

For example, customers can now specify `dockerfile`, `context`, and `args` underneath the `build` key in the manifest, or simply specify a dockerfile path at `build`.

#### Example 1
```yaml
image:
  build: path/to/MyDockerfile
```
This manifest will build the dockerfile specified at `build`, using the directory `path/to` as the build context. 

#### Example 2
```yaml
image:
  build:
    dockerfile: path/to/MyDockerfile
    context: path/to/service/code
    args:
      ABC: 123
      arg2: value2
```
This example will build the dockerfile at `path/to/MyDockerfile` using the directory `path/to/service/code` as the build context and passing the args as `--build-arg` flags. 

Fixes  #822 and #1030

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issues that are bugs.
Projects
None yet
Development

No branches or pull requests

3 participants