Skip to content

How can I use Amazon Linux 2023 for AWS CodeBuild Runner Projects? Still getting AL2

0

Hi all,

I'm running into a frustrating problem with AWS CodeBuild runner projects, and I'm hoping someone in the community knows how to fix (or at least explain!) it.

What I'm doing: I'm setting up a CodeBuild-hosted runner project (not just a regular CodeBuild build, but a managed runner for GitHub Actions). My config is:

  • Provisioning model: On-demand
  • Environment image: Managed image
  • Compute: EC2, Running mode: Instance
  • OS: Amazon Linux
  • Image: aws/codebuild/ami/amazonlinux-x86_64-base:latest

The Problem: Even though AWS announced ages ago that AL2023 is the new default for CodeBuild, my projects still end up using Amazon Linux 2. My build prints out this kernel info:

Linux ip-10-0-55-250.us-west-2.compute.internal 4.14.355-280.684.amzn2.x86_64 #1 SMP Tue Sep 9 11:18:19 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

This is definitely AL2 (4.14.x and “amzn2” in the name). My problem is that something my builds depend on only works with Amazon Linux 2023, not AL2.

What I've tried:

  • Looking for AL2023 images or runtimes in the UI - nothing but “base” and “amazonlinux” (both bring up AL2)
  • Double-checked region, switched between EC2 and container runners - same issue
  • Read docs, forum posts, and AWS announcements - still no solution

My Questions:

  1. Has anyone actually managed to get a CodeBuild runner project (not just a regular build) to run on Amazon Linux 2023?
  2. Is this a region lag, a runner limitation, or am I missing a hidden config?
  3. Is there a way to force or request AL2023 for these runner projects, or do I just have to wait?
  4. Is there any workaround to get AL2023 for now? It’s a blocker for us.

Would really appreciate any practical advice, pointers, or confirmation from anyone who has solved (or is also stuck on) this. Thanks!

1 Answer
0

Based on the AWS CodeBuild documentation, to use Amazon Linux 2023 for your CodeBuild-hosted GitHub Actions runner, you need to make specific configuration choices in your runner setup.

For EC2 compute with Amazon Linux 2023, you should use one of these configurations:

  1. For x86_64 architecture:
  • Environment type: linux
  • Image identifier: 5.0
  • Platform: Amazon Linux 2023
  • Resolved image: aws/codebuild/amazonlinux-x86_64-standard:5.0
  1. Alternatively, for EC2 instances:
  • Environment type: linux-ec2
  • Image identifier: latest
  • Platform: Amazon Linux 2023
  • Resolved image: aws/codebuild/ami/amazonlinux-x86_64-base:latest
  1. For ARM architecture:
  • Environment type: arm
  • Image identifier: 3.0
  • Platform: Amazon Linux 2023
  • Resolved image: aws/codebuild/amazonlinux-aarch64-standard:3.0

The issue you're experiencing might be because you're using the image identifier aws/codebuild/ami/amazonlinux-x86_64-base:latest directly, rather than using the environment type and image identifier combination that maps to AL2023.

When configuring your runner, make sure you're using the proper label overrides in your configuration file. For GitHub Actions runners, you would specify these values in the runner configuration where you set up the CodeBuild-hosted runner.

If you're still experiencing issues after making these changes, it could be related to regional availability or a specific limitation with the runner implementation.
Sources
Compute images supported with the CodeBuild-hosted GitHub Actions runner - AWS CodeBuild
EC2 compute images - AWS CodeBuild
Compute images supported with the CodeBuild-hosted GitLab runner - AWS CodeBuild

answered a month ago
  • Unfortunately, this still doesn’t solve my problem. Here’s what I’ve observed:

    • When I set up my CodeBuild-hosted GitHub Actions runner in the AWS Console, I do not see an option for “Amazon Linux 2023”, “linux-5.0”, or any of the specific image identifiers mentioned in documentation or your answer.
    • The only available or visible managed images for EC2 compute are:
      • aws/codebuild/ami/amazonlinux-x86_64-base:latest
      • there’s an ARM equivalent.
    • When I proceed with the available options, my runner consistently provisions Amazon Linux 2 (AL2)—the kernel string clearly shows amzn2, not AL2023.

    What I’ve tried already:

    • Adding image label overrides (e.g., image:linux-5.0) directly in the runs-on section of my GitHub Actions workflow file, per AWS docs and advice here.
    • Despite these overrides, the runner still uses AL2; I always get the same AL2 kernel in the build output.

    What I’m looking for:

    • A way to actually make AL2023 available as the environment for my CodeBuild-hosted runner, either as a selectable UI option, working label override, or via any other method.
    • If this is a region/account limitation or rollout delay, clear info on when or how this will be enabled.
    • If there’s a sample or working example from the AWS Console or CLI (not just what’s documented), that would be extremely helpful.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.