Aws-codebuild-docker-images: aws/codebuild/amazonlinux2-x86_64-standard:2.0 misleading build log for docker runtime version

Created on 11 Dec 2019  路  9Comments  路  Source: aws/aws-codebuild-docker-images

From the following file:
https://github.com/aws/aws-codebuild-docker-images/blob/master/al2/x86_64/standard/2.0/runtimes.yml

the following line:
- echo "Specifying docker version in buildspec is deprecated. Using docker $DOCKER_VERSION ."

causes confusion when reviewing the build output, especially of a failed build.

Repro:

Make a buildspec that includes this runtime version:

phases:
  install:
    runtime-versions:
      docker: 18

Run a build that uses this buildspec and aws/codebuild/amazonlinux2-x86_64-standard:2.0.

Check the build logs, it'll have the confusing message.

Most helpful comment

@zygimantas - The update hasn't rolled out yet. I'm explaining the future state. For now, you will need to use "docker: 18" and privileged mode, until this bug is fixed.

All 9 comments

@philn5d-ar - Thanks for calling that out. This will be addressed in the next few days. Once that update is in place, you shouldn't need to specify the docker version in the "runtime-versions". We'll implicitly picking up the latest available version of docker for your builds.

@subinataws I wondered about that. It'll make the buildspec simpler for sure, although ours is already fairly simple as it is. Thanks!

No, that does not make it simple:

[Container] 2020/01/06 16:32:14 Phase context status code: YAML_FILE_ERROR Message: This build image requires selecting at least one runtime version.

What if docker is the only runtime I need?

@zygimantas - We are adding an implicit runtime version selection in buildspec, which would be the new default. If you specify a runtime-version, that version will be picked up. If you do not specify a runtime-version, then the latest version for the runtime will be selected by default.

For Docker, you will only need to select the "privileged" mode in the Project setting, once the updates fully roll out.

I have priviledged mode enabled and I get an error, mentioned in a previous post, if I omit runtime setting in buildspec

image

image

@zygimantas - The update hasn't rolled out yet. I'm explaining the future state. For now, you will need to use "docker: 18" and privileged mode, until this bug is fixed.

thanks

Just ran into this!
plz be sure to update also the docs: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html

Hi there, this is Aditya from AWS CodeBuild. This update has been rolled out. You can now leave the "runtime-versions" section empty and have latest runtime versions selected by default. You shouldn't encounter the following error anymore:

[Container] 2020/01/06 16:32:14 Phase context status code: YAML_FILE_ERROR Message: This build image requires selecting at least one runtime version.

Was this page helpful?
0 / 5 - 0 ratings