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

Rebuilding the image from dockerfile on version 2.5.6 #217

Open
pneves-ciandt opened this issue Nov 11, 2022 · 0 comments
Open

Rebuilding the image from dockerfile on version 2.5.6 #217

pneves-ciandt opened this issue Nov 11, 2022 · 0 comments

Comments

@pneves-ciandt
Copy link

pneves-ciandt commented Nov 11, 2022

I have the following code:

const imageArm64 = new DockerImageAsset(this, 'myproject-arm64', {
            directory: './',
            file: 'myproject-arm64.docker',
            platform: Platform.LINUX_ARM64,
            exclude: ['cdk.out'],
            buildArgs: {
                BUILD_VERSION: MajorMinorVersion + '.' + process.env.CODEBUILD_BUILD_NUMBER,
            },
        });

new ecrdeploy.ECRDeployment(this, 'DeployDockerImageArm64', {
            src: new ecrdeploy.DockerImageName(imageArm64.imageUri),
            dest: new ecrdeploy.DockerImageName(`${props.env?.account}.dkr.ecr.${props.env?.region}.amazonaws.com/myproject:arm64-latest`),
        });

But when the pipeline builds, it generates two Docker Assets, one from DockerImageAsset which builds successfully and another one from the ECRDeployment which fails to build because it doesn't have the other build details I pass on the DockerImageAsset. As far as I understand, shouldn't the ECRDeployment just deploy the image to the dest repo? Why is it building again? I am using the cdk-ecr-deployment on version 2.5.6 and aws-cdk-lib on version 2.42.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant