I am encountering an issue with AWS CodeBuild when trying to specify the Docker runtime version using AWS Systems Manager Parameter Store. I am hoping to get some insights or solutions from those who might have faced a similar problem.
Here's the snippet of my buildspec.yml:
version: 0.2
env:
parameter-store:
DOCKER_VERSION: docker-version
phases:
install:
runtime-versions:
docker: $DOCKER_VERSION
I have defined docker-version in AWS SSM Parameter Store with the value '20'. When I trigger the build, it fails at the build stage with the following error:
Phase context status code: YAML_FILE_ERROR Message: Unknown runtime version named '**.10.24' of docker. This build image has the following versions: **
Interestingly, when I specified the Docker version via variables in the buildspec.yml like so:
version: 0.2
env:
variables:
DOCKER_VERSION: 20
phases:
install:
runtime-versions:
docker: $DOCKER_VERSION
It works without any issues. The following also worked:
version: 0.2
env:
parameter-store:
RUBY_VERSION: ruby-version #defined in Parameter Store with the value '3.1'
phases:
install:
runtime-versions:
ruby: $RUBY_VERSION
Is there a known issue with referencing Docker versions from the Parameter Store in AWS CodeBuild's buildspec.yml? Any advice or insights would be greatly appreciated. Thank you in advance for your help!