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

DockerImageAsset: exclude option is ignored #4353

Closed
kuwabarahiroshi opened this issue Oct 3, 2019 · 1 comment · Fixed by #4354
Closed

DockerImageAsset: exclude option is ignored #4353

kuwabarahiroshi opened this issue Oct 3, 2019 · 1 comment · Fixed by #4354
Assignees
Labels
@aws-cdk/aws-ecr Related to Amazon Elastic Container Registry bug This issue is a bug. in-progress This issue is being actively worked on.

Comments

@kuwabarahiroshi
Copy link
Contributor

kuwabarahiroshi commented Oct 3, 2019

DockerImageAsset is documented that it has exclude? property.

Then, I specified my image such as below:

const image = new DockerImageAsset(this, 'MyProjectImage', {
  directory: path.join(__dirname, '..', '..'),
  repositoryName: 'my-project',
  exclude: ['cdk', 'node_modules', 'tmp', 'log', 'storage', 'vendor']
});

It worked until v1.9.0, but the property is ignored since v1.10.0.

I found 8389eeb is just overriding the exclude property.

Workaround is to list those files into .dockerignore. But .dockerignore and exclude option behaves a little different.

Reproduction Steps

const image = new DockerImageAsset(this, 'MyProjectImage', {
  directory: '.',
  repositoryName: 'my-project',
  exclude: ['cdk', 'node_modules', 'tmp', 'log', 'storage', 'vendor']
});

cdk.out shouldn't include those files listed in exclude option.

Environment

  • CLI Version : >= v1.10.0
  • Framework Version:
  • OS : Mac OSX 10.14.5
  • Language : TypeScript

Other

I just wanted to avoid this issue: #3899


This is 🐛 Bug Report

@kuwabarahiroshi kuwabarahiroshi added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 3, 2019
@kuwabarahiroshi kuwabarahiroshi changed the title DockerImageAsset: eclude option is ignored DockerImageAsset: exclude option is ignored Oct 3, 2019
@NGL321 NGL321 added @aws-cdk/aws-ecr Related to Amazon Elastic Container Registry in-progress This issue is being actively worked on. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 3, 2019
@NGL321
Copy link
Contributor

NGL321 commented Oct 3, 2019

Hey @kuwabarahiroshi!

Thank you so much for contributing. This issue should be closed out once your PR is merged.

@mergify mergify bot closed this as completed in #4354 Oct 3, 2019
mergify bot pushed a commit that referenced this issue Oct 3, 2019
* fix(@aws-cdk/aws-ecr-assets): `exclude` option (#4353)

fixed #4353

* .dockerignore itself should be included
* fixed test path with image.sourceHash

* modified excluded path to be tested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecr Related to Amazon Elastic Container Registry bug This issue is a bug. in-progress This issue is being actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants