Runtime versions - Amazon CodeBuild
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Runtime versions

When you specify a runtime in the runtime-versions section of your buildspec file, you can specify a specific version, a specific major version and the latest minor version, or the latest version. The following table lists the available runtimes and how to specify them. Not all runtime versions are available on all images. Runtime version selection is also not supported for the custom images. For more information, see Available runtimes. If you'd like to install and use a custom runtime version instead of the pre-installed runtime versions, see Custom runtime versions.

Ubuntu and Amazon Linux 2 platform runtime versions
Runtime name Version Specific version Specific major and latest minor version Latest version
android

28

android: 28

android: 28.x

android: latest

29

android: 29

android: 29.x

dotnet

3.1

dotnet: 3.1

dotnet: 3.x

dotnet: latest

5.0

dotnet: 5.0

dotnet: 5.x

6.0

dotnet: 6.0

dotnet: 6.x

8.0

dotnet: 8.0

dotnet: 8.x

golang

1.12

golang: 1.12

golang: 1.x

golang: latest

1.13

golang: 1.13

1.14

golang: 1.14

1.15

golang: 1.15

1.16

golang: 1.16

1.18

golang: 1.18

1.20

golang: 1.20

1.21

golang: 1.21

1.22

golang: 1.22

java

corretto8

java: corretto8

java: corretto8.x

java: latest

corretto11

java: corretto11

java: corretto11.x

corretto17

java: corretto17

java: corretto17.x

corretto21

java: corretto21

java: corretto21.x

nodejs

10

nodejs: 10

nodejs: 10.x

nodejs: latest

12

nodejs: 12

nodejs: 12.x

14

nodejs: 14

nodejs: 14.x

16

nodejs: 16

nodejs: 16.x

18

nodejs: 18

nodejs: 18.x

20

nodejs: 20

nodejs: 20.x

22

nodejs: 22

nodejs: 22.x

php

7.3

php: 7.3

php: 7.x

php: latest

7.4

php: 7.4

8.0

php: 8.0

php: 8.x

8.1

php: 8.1

8.2

php: 8.2

8.3

php: 8.3

python

3.7

python: 3.7

python: 3.x

python: latest

3.8

python: 3.8

3.9

python: 3.9

3.10

python: 3.10

3.11

python: 3.11

3.12

python: 3.12

ruby

2.6

ruby: 2.6

ruby: 2.x

ruby: latest

2.7

ruby: 2.7

3.1

ruby: 3.1

ruby: 3.x

3.2

ruby: 3.2

3.3

ruby: 3.3

You can use a build specification to install other components (for example, the Amazon CLI, Apache Maven, Apache Ant, Mocha, RSpec, or similar) during the install build phase. For more information, see Buildspec example.

Custom runtime versions

Instead of using the pre-installed runtime versions in CodeBuild-managed images, you can install and use custom versions of your choice. The following table lists the available custom runtimes and how to specify them.

Note

Custom runtime version selection is only supported for Ubuntu and Amazon Linux images.

Custom runtime versions
Runtime name Syntax Example
dotnet

<major>.<minor>.<patch>

5.0.408

golang

<major>.<minor>

<major>.<minor>.<patch>

1.19

1.19.1

java

corretto<major>

corretto15

nodejs

<major>

<major>.<minor>

<major>.<minor>.<patch>

14

14.21

14.21.3

php

<major>.<minor>.<patch>

8.0.30

python

<major>

<major>.<minor>

<major>.<minor>.<patch>

3

3.7

3.7.16

ruby

<major>.<minor>.<patch>

3.0.6

Custom runtime buildspec example

Here is an example of a buildspec that specifies custom runtime versions.

version: 0.2 phases: install: runtime-versions: java: corretto15 php: 8.0.30 ruby: 3.0.6 golang: 1.19 python: 3.7 nodejs: 14 dotnet: 5.0.408