-
Notifications
You must be signed in to change notification settings - Fork 4k
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
ecr-assets: incomplete .dockerignore support #4450
Comments
This comment has been minimized.
This comment has been minimized.
Sorry about my previous comment, from what I can see it's working completely fine,
const expectedFiles = [
'.dockerignore',
'Dockerfile',
'index.py',
'foo.txt',
path.join('subdirectory', 'baz.txt'),
path.join('deep', 'include_me', 'sub', 'dir', 'quuz.txt'),
];
const unexpectedFiles = [
'foobar.txt',
path.join('deep', 'dir', 'struct', 'qux.txt'),
path.join('subdirectory', 'quux.txt'),
];
for (const expectedFile of expectedFiles) {
test.ok(fs.existsSync(path.join(session.directory, `asset.${image.sourceHash}`, expectedFile)), expectedFile);
}
for (const unexpectedFile of unexpectedFiles) {
test.ok(!fs.existsSync(path.join(session.directory, `asset.${image.sourceHash}`, unexpectedFile)), unexpectedFile);
} I can add this test case to |
@nmussy Please try to add a '*' as your first pattern in
After the synth phase I get the following asset:
Howerver, I really expect to see this:
|
I see, thanks for clearing it up for me. But I don't understand why you would expect anything but
|
Hm... My assumption is that Without Am I missing something here? |
You're completely right, the |
Here's what I've found:
aws-cdk/packages/@aws-cdk/assets/lib/fs/copy.ts Lines 21 to 23 in dcd8d1e
So in the case of
We need to figure out how to affect either |
I have today the same problem with: cdk 1.103.0 (build bc13a66) @aws-cdk/assets 1.103.0 OS: osx 11.3.1 typescript language |
Introduced by #4104.
CDK does not handle the common "exclude everything except" pattern for .dockerignore files:
Quote from Docker docs:
With the current implementation the first 'star' glob effectively excludes everything from the asset folder dyring synth stage. Consequently, deploy stage fails to build the docker image.
Reproduction Steps
.dockerignore
file next to youDockerfile
with * pattern, like this:cdk deploy
Error Log
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: