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.
Runtime name | Version | Specific version | Specific major and latest minor version | Latest version |
---|---|---|---|---|
android |
28 |
|
|
|
29 |
|
|
||
dotnet |
3.1 |
|
|
|
5.0 |
|
|
||
6.0 |
|
|
||
8.0 |
|
|
||
golang |
1.12 |
|
|
|
1.13 |
|
|||
1.14 |
|
|||
1.15 |
|
|||
1.16 |
|
|||
1.18 |
|
|||
1.20 |
|
|||
1.21 |
|
|||
1.22 |
|
|||
java |
corretto8 |
|
|
|
corretto11 |
|
|
||
corretto17 |
|
|
||
corretto21 |
|
|
||
nodejs |
10 |
|
|
|
12 |
|
|
||
14 |
|
|
||
16 |
|
|
||
18 |
|
|
||
20 |
|
|
||
22 |
|
|
||
php |
7.3 |
|
|
|
7.4 |
|
|||
8.0 |
|
|
||
8.1 |
|
|||
8.2 |
|
|||
8.3 |
|
|||
python |
3.7 |
|
|
|
3.8 |
|
|||
3.9 |
|
|||
3.10 |
|
|||
3.11 |
|
|||
3.12 |
|
|||
ruby |
2.6 |
|
|
|
2.7 |
|
|||
3.1 |
|
|
||
3.2 |
|
|||
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.
Runtime name | Syntax | Example |
---|---|---|
dotnet |
|
|
golang |
|
|
java |
|
|
nodejs |
|
|
php |
|
|
python |
|
|
ruby |
|
|
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