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.11k stars 973 forks source link

Ubuntu:6.0 and Ubuntu:7.0 docker builds stall and then fail #649

Closed charlie-harvey closed 1 year ago

charlie-harvey commented 1 year ago

Describe the bug I try to run a build using docker-compose where I run my tests inside the docker image. This way the test framework connects to various containers like a database/redis.

NODE_ENV=ci docker-compose run my-service /bin/sh -c \"sleep 15 && NODE_ENV=ci npm run migrate:ci:up && npm run test:ci:cov\" && NODE_ENV=ci docker-compose down --remove-orphans

To Reproduce Run a test using docker in any way? I can't seem to get it to work at all.

Expected behavior Images should be downloaded, tests should kick off.

Logs Logs do this for about 10 minutes. Then it just stops. Then the build will time out when it reaches whatever I set for a timeout.

 b05e777ad7b0 Extracting [======================================>            ]  91.36MB/119.7MB
 b05e777ad7b0 Extracting [======================================>            ]  93.03MB/119.7MB
 b05e777ad7b0 Extracting [=======================================>           ]   94.7MB/119.7MB
 b05e777ad7b0 Extracting [========================================>          ]  96.37MB/119.7MB
 b05e777ad7b0 Extracting [========================================>          ]  98.04MB/119.7MB
 b05e777ad7b0 Extracting [=========================================>         ]  99.71MB/119.7MB
 b05e777ad7b0 Extracting [==========================================>        ]  101.4MB/119.7MB
 b05e777ad7b0 Extracting [==========================================>        ]  102.5MB/119.7MB
 b05e777ad7b0 Extracting [===========================================>       ]  104.2MB/119.7MB
 b05e777ad7b0 Extracting [===========================================>       ]  104.7MB/119.7MB
 b05e777ad7b0 Extracting [============================================>      ]  105.8MB/119.7MB
 b05e777ad7b0 Extracting [============================================>      ]  106.4MB/119.7MB
 b05e777ad7b0 Extracting [============================================>      ]    107MB/119.7MB
 b05e777ad7b0 Extracting [============================================>      ]  107.5MB/119.7MB

Platform (please complete the following information):

If I use one single image it gets pulled. If I use two or more images, the pull never completes.

docker-compose.yml

version: "3.7"
services:
  dashboard-service:
    image: "my-service:latest"
    restart: always
    environment:
      NODE_ENV: ${NODE_ENV}
    depends_on:
      - database
      # - redis-cluster
      # - localstack
      # - sns-sqs-cdk-stack

  database:
    image: "public.ecr.aws/docker/library/mysql:5.7"
    platform: linux/amd64
    volumes:
      - "./docker/mysql/etc/mysql.cnf:/etc/mysql/conf.d/mysql.cnf"
      - "./docker/mysql/init:/docker-entrypoint-initdb.d"
    environment:
      MYSQL_ROOT_PASSWORD: "secret"

  # redis-cluster:
  #   image: "XXXXXXXX.dkr.ecr.us-east-2.amazonaws.com/redis-cluster:6.2"
  #   environment:
  #     INITIAL_PORT: 6376

  # localstack:
  #   image: "public.ecr.aws/localstack/localstack:2.0"
  #   ports:
  #     - "4566-4599:4566-4599"
  #   environment:
  #     - DOCKER_HOST=unix:///var/run/docker.sock
  #     - LS_LOG=error
  #   # volumes:
  #   #   - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
  #   privileged: true

  # sns-sqs-cdk-stack:
  #   image: "XXXXXXXX.dkr.ecr.us-east-2.amazonaws.com/sns-sqs-cdk-stack:latest"
  #   environment:
  #     TEMPLATE: ci
  #     LOCALSTACK_HOST: localstack:4566
charlie-harvey commented 1 year ago

I'm trying to take my projects from Node14 to Node16 and the only way to do that is to go from Ubuntu:5.0 to Ubuntu:6.0 (for Node16) or Ubuntu:7.0 (for Node18). I'd love to stay on the same build image since it still actually downloads docker images. But Node16 and Node18 are not available.

charlie-harvey commented 1 year ago

I am running my build commands in a ruby script. The script is holding onto those thousands of lines of logging and then stalling. If I run the build steps without my ruby script it works.