AWS CodeBuild Docker Images
AWS has evolved the way they manage their official curated images over the years. Here are some useful notes. It’s more focused on Linux images.
- 2018 Strategy was to build separate Docker images for different runtimes like Java, Python, Go, Ruby, PHP, Node, etc
- 2019 AWS shifted its strategy to build one baseline image. We specify the desired runtimes to be installed. Docs here: Runtime versions in buildspec file sample for CodeBuild
The interesting thing about this shift is that it makes it easier to install multiple runtimes if needed. For example, you might need the Ruby runtime but also need the NodeJS runtime for asset compilation.
Here’s a useful command to list the images:
aws codebuild list-curated-environment-images | jq '.platforms.languages.images.name'
There are 2 different types of standard images. Here are examples of each type:
- aws/codebuild/standard:4.0: Based on Ubuntu.
- amazonlinux2-x86_64-standard:3.0: Based on AmazonLinux2.
As of this writing, it looks like Ubuntu images have more recent versions of Ruby. For example, Ubuntu has Ruby 2.7 and AmazonLinux has Ruby 2.6.
Pro tip: Use the <- and -> arrow keys to move back and forward.