-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
lambda: Creating a LambdaFunction with DockerImageFunction, DockerImageAsset & DockerImageFunctionProps #26195
Comments
Have you tried This works for me in TypeScript const func = new lambda.DockerImageFunction(this, 'Imagefunc', {
code: lambda.DockerImageCode.fromImageAsset(path.join(__dirname, '../docker.d')),
}) If you really need const dockerImageAsset = new DockerImageAsset(this, 'ImageAsset', {
directory: path.join(__dirname, '../docker.d'),
})
const func = new lambda.DockerImageFunction(this, 'Imagefunc', {
// code: lambda.DockerImageCode.fromImageAsset(path.join(__dirname, '../docker.d')),
code: lambda.DockerImageCode.fromEcr(dockerImageAsset.repository, {
tagOrDigest: dockerImageAsset.imageTag,
})
}) |
Interesting your error message seems a golang error. Are you deploying this manually with CDK CLI from a local env? |
Hi Pahud, Thanks for your quick feedback. I tried once with your suggestion (DockerImageCode.fromImageAsset) The behaviour was the same. The same error. Look the output:
w.r.t your other question: I'm deploying with cdk deploy: npx aws-cdk deploy MY_STACK --profile assets-repository |
I have the same error log with docker login. |
I updated my Docker and it looks like : I tried once to deploy, but I'm getting the same error :( hier in text-form `BUILD SUCCESSFUL in 37s ✨ Synthesis time: 38.17s ADVANCED: start: Building d37ffa7c6dbeadfeecbaf54a982293c60504d4a2717881f99bbf748c4cfd4d4c:current_account-current_region goroutine 1 [running]: ❌ Deployment failed: Error: Failed to build asset d37ffa7c6dbeadfeecbaf54a982293c60504d4a2717881f99bbf748c4cfd4d4c:current_account-current_region Failed to build asset d37ffa7c6dbeadfeecbaf54a982293c60504d4a2717881f99bbf748c4cfd4d4c:current_account-current_region` |
I was able to fix this by editing
to
|
Great..
Will it be in the next release available?
Best Regards,
Alex Sadler ***@***.***> schrieb am Di., 18. Juli 2023, 14:13:
… I was able to fix this by editing ~/.docker/config.json
Somehow it was initialised in a way that meant docker couldn't handle it,
so I changed from:
"auths": null,
...
}```
to
```{
"auths": {},
...
}```
—
Reply to this email directly, view it on GitHub
<#26195 (comment)>, or
unsubscribe
<https:/notifications/unsubscribe-auth/AGJTXK4RIKACMIF2RTCUOPDXQZ4XTANCNFSM6AAAAAAZ3ILZWE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I don't know, it's an issue with docker and I'm just some random person on the internet and I happen to have figured out how to work around the issue
18 Jul 2023 19:33:35 Miguel ***@***.***>:
…
Great..
Will it be in the next release available?
Best Regards,
Alex Sadler ***@***.***> schrieb am Di., 18. Juli 2023, 14:13:
> I was able to fix this by editing ~/.docker/config.json
> Somehow it was initialised in a way that meant docker couldn't handle it,
> so I changed from:
>
> "auths": null,
> ...
> }```
> to
> ```{
> "auths": {},
> ...
> }```
>
> —
> Reply to this email directly, view it on GitHub
> <#26195 (comment)>, or
> unsubscribe
> <https:/notifications/unsubscribe-auth/AGJTXK4RIKACMIF2RTCUOPDXQZ4XTANCNFSM6AAAAAAZ3ILZWE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub[#26195 (comment)], or unsubscribe[https:/notifications/unsubscribe-auth/AAKL6JDZ3HPXG3PP5DY6KA3XQ3JHXANCNFSM6AAAAAAZ3ILZWE].
You are receiving this because you commented.[Tracking image][https:/notifications/beacon/AAKL6JEZMIAZOIB7JTJRJXLXQ3JHXA5CNFSM6AAAAAAZ3ILZWGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTBZPED2.gif]
|
This does appear to be a docker issue. It's been fixed and merged, probably in the next docker update |
Describe the bug
BUILD SUCCESSFUL in 23s
6 actionable tasks: 1 executed, 5 up-to-date
✨ Synthesis time: 23.57s
ADVANCED: start: Building 6e1cddd7d93b113a27547038f2962e6740fa861c33262dd8e6587ea19641a84b:current_account-current_region
ADVANCED: fail: docker login --username AWS --password-stdin https://279280305777.dkr.ecr.eu-west-1.amazonaws.com exited with error code 2: panic: assignment to entry in nil map
goroutine 1 [running]:
github.com/docker/cli/cli/config/credentials.(*fileStore).Store(0xc0003cc0c0, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0xc0000404c8, ...}, ...})
/go/src/github.com/docker/cli/cli/config/credentials/file_store.go:55 +0x49
github.com/docker/cli/cli/config/credentials.(*nativeStore).Store(0xc0000081f8, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0xc0000404c8, ...}, ...})
/go/src/github.com/docker/cli/cli/config/credentials/native_store.go:95 +0xb5
github.com/docker/cli/cli/command/registry.runLogin({0x12a5cd8, 0xc0003841e0}, {{0xc0000404c0, 0x34}, {0xc000042118, 0x3}, {0xc0000d8900, 0x87c}, 0x1})
/go/src/github.com/docker/cli/cli/command/registry/login.go:156 +0x55d
github.com/docker/cli/cli/command/registry.NewLoginCommand.func1(0xc000005b00?, {0xc00013b240?, 0x1?, 0x4?})
/go/src/github.com/docker/cli/cli/command/registry/login.go:46 +0x72
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc000005b00, {0xc0003402e0, 0x4, 0x4})
/go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:940 +0x862
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc000004300)
/go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:1068 +0x3bd
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(...)
/go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:992
main.runDocker(0x0?)
/go/src/github.com/docker/cli/cmd/docker/docker.go:263 +0x4b7
main.main()
/go/src/github.com/docker/cli/cmd/docker/docker.go:274 +0x97
❌ Deployment failed: Error: Failed to build asset 6e1cddd7d93b113a27547038f2962e6740fa861c33262dd8e6587ea19641a84b:current_account-current_region
at Deployments.buildSingleAsset (C:\Users\Rojas-GonzálezDrIngM\AppData\Roaming\npm\node_modules\aws-cdk\lib\index.js:415:11476)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.buildAsset (C:\Users\Rojas-GonzálezDrIngM\AppData\Roaming\npm\node_modules\aws-cdk\lib\index.js:415:150805)
at async C:\Users\Rojas-GonzálezDrIngM\AppData\Roaming\npm\node_modules\aws-cdk\lib\index.js:415:137021
Failed to build asset 6e1cddd7d93b113a27547038f2962e6740fa861c33262dd8e6587ea19641a84b:current_account-current_region
Expected Behavior
The Docker Image should be created
Current Behavior
An error happens trying to get credentials for ECR:
fail: docker login --username AWS --password-stdin https://279280305777.dkr.ecr.eu-west-1.amazonaws.com exited with error code 2: panic: assignment to entry in nil map
Reproduction Steps
JavaCode:
` Map<String, String> environment = new HashMap<>();
environment.put(_USECASE_LAMBDA_DOCKER_NAME, "Customized by MR!");
environment.put("DEBUG", "true");
environment.put("ls", "true");
environment.put("times", "1000");
Possible Solution
No response
Additional Information/Context
I'm using an AWS Profile for building and deploying. If the lambda function is commented out, the stack will be deployed succesfully. The error happens as soon the docker stuff will be executed. This means, the current problem is not related to the credentials I'm using via aws profile.
CDK CLI Version
2.86
Framework Version
No response
Node.js Version
9.5.1
OS
Windows
Language
Java
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: