-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-ecrRelated to Amazon Elastic Container RegistryRelated to Amazon Elastic Container RegistrybugThis issue is a bug.This issue is a bug.in-progressThis issue is being actively worked on.This issue is being actively worked on.management/devenvRelated to CDK development/build environmentRelated to CDK development/build environmentp2
Description
Introduced by #4104.
CDK does not handle the common "exclude everything except" pattern for .dockerignore files:
# Ignore everything
*
# Allow files and directories
!/src/**Quote from Docker docs:
... you may want to specify which files to include in the context, rather than which to exclude. To achieve this, specify * as the first pattern, followed by one or more ! exception patterns.
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
- Create a
.dockerignorefile next to youDockerfilewith * pattern, like this:# Ignore everything * # Allow files and directories !/src/**
- Run
cdk deploy
Error Log
unable to prepare context: unable to evaluate symlinks in Dockerfile path: CreateFile C:\Dev\GitHub\playground\EcsWindowsCluster\src\Deployment\cdk.out\asset.1ebc9d3ac2033816c4abb63e4afd69d350b4aba8704cc9236b82ea520b74f4b0\Dockerfile: The system cannot find the file specified.
❌ win failed: Error: docker build --tag 305168429857.dkr.ecr.eu-west-1.amazonaws.com/cdk/win:latest cdk.out\asset.1ebc9d3ac2033816c4abb63e4afd69d350b4aba8704cc9236b82ea520b74f4b0 exited with error code 1
docker build --tag 305168429857.dkr.ecr.eu-west-1.amazonaws.com/cdk/win:latest cdk.out\asset.1ebc9d3ac2033816c4abb63e4afd69d350b4aba8704cc9236b82ea520b74f4b0 exited with error code 1
Environment
- CLI Version : 1.12.0 (build 923055e)
- OS : Windows
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-ecrRelated to Amazon Elastic Container RegistryRelated to Amazon Elastic Container RegistrybugThis issue is a bug.This issue is a bug.in-progressThis issue is being actively worked on.This issue is being actively worked on.management/devenvRelated to CDK development/build environmentRelated to CDK development/build environmentp2