aws / aws-codebuild-docker-images

Official AWS CodeBuild repository for managed Docker images http://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref.html
Other
1.12k stars 974 forks source link

Is docker runtime version '18' deprecated? #617

Closed JeongJaeSoon closed 1 year ago

JeongJaeSoon commented 1 year ago

Describe the bug When trying to use docker version 18 to build an image with ECS it fails with the error

[Container] 2023/03/31 03:13:58 Phase complete: DOWNLOAD_SOURCE State: FAILED
[Container] 2023/03/31 03:13:58 Phase context status code: YAML_FILE_ERROR Message: Unknown runtime version named '18' of docker. This build image has the following versions: 20

The latest build from 2023/03/14 succeeded without issues. Looking at the success log at the time, the following message was output, so I would like to know if the docker runtime version '18' was deprecated.

[Container] 2023/03/14 02:53:23 Processing environment variables
[Container] 2023/03/14 02:53:23 Decrypting parameter store environment variables
[Container] 2023/03/14 02:53:24 Selecting 'docker' runtime version '18' based on manual selections...
[Container] 2023/03/14 02:53:24 Running command echo "Specifying docker version in buildspec is deprecated. Using docker $DOCKER_VERSION"
Specifying docker version in buildspec is deprecated. Using docker 20.10.22

To Reproduce Steps to reproduce the behavior:

  1. Add and commit changes to the application
  2. Automatic execution of CodeBuild via CodePipeline (no modifications related to CodeBuild)
    • include the following phase
      phases:
      install:
      runtime-versions:
        docker: 18
  3. Build Failed

    ps. Deployment was successful when building was executed manually by modifying only the lower part of CodeBuild.yml in the Buildspec in the AWS Console.

    phases:
      install:
        runtime-versions:
          docker: 20

Expected behavior The build should succeed using docker 18. or The answer to the question that version 18 is deprecated. (I would appreciate it if you could share a document that I can refer to.)

Logs

[Container] 2023/03/31 03:13:58 Phase complete: DOWNLOAD_SOURCE State: FAILED
[Container] 2023/03/31 03:13:58 Phase context status code: YAML_FILE_ERROR Message: Unknown runtime version named '18' of docker. This build image has the following versions: 20

Platform (please complete the following information):

subinataws commented 1 year ago

@JeongJaeSoon - You no longer need to specify docker version under runtime-versions. That is not supported anymore and the latest docker version installed on that image is automatically used. You should enable the privileged mode on your project to access docker within the build container though.