skip to Main Content

I do not see a way to use correto21 (java 21) to build a docker image in aws. For EC2 codebuilds, there is only up to correto11, where is the option for correto21 or 17? I see an option for lamda, and it offers correto21, but there isn’t a way to use docker on it. I have found that if we select "privileged" flag it allows docker access. On lambda codebuild, there is not "privileged" flag.

So in summary with codebuild ec2 settings there is "privledged" flag to allow docker access but no java 21. With lambda there is java 21 (correto21) but no "privledged" flag for docker access.

I don’t mind using either one, I just need java 21 and docker image creation access in codebuild. Is there any other somekind of image that does this? I don’t want to slow down our build by having to install java or docker during our build process, but that might be the only option.

this is the command that fails in the ec2 codebuild because I can only select correto11 at most

   runtime-versions:
   java: corretto21

this is the command that fails in lamdba on the correto21 image

    commands:
  - aws ecr get-login-password --region $AWS_REGION | docker login --username xxx --password-stdin xxx

2

Answers


  1. Chosen as BEST ANSWER

    We found a way to build it by changing the build project correto to amazon linux standard5.0 image. This allowed us to install 21 (I guess we will have to install it) and use docker.


  2. You’re probably picking an older version of a CodeBuild runtime that doesn’t support the newer Corretto versions. You have to look at this page to determine what CodeBuild runtimes support the versions you need.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search