diff --git a/README.md b/README.md index fd69fa1..c891a6d 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,17 @@ Then, * to run integration tests: `make test-integ` * to run smoke tests: `make test-smoke` +### Troubleshooting +While running integration tests, you might encounter the Docker Hub rate limit error with the following body: +``` +You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits +``` +To fix the above issue, consider authenticating to a Docker Hub account by setting the Docker Hub credentials as below CodeBuild environment variables. +```shell script +DOCKERHUB_USERNAME= +DOCKERHUB_PASSWORD= +``` +Recommended way is to set the Docker Hub credentials in CodeBuild job by retrieving them from AWS Secrets Manager. ## Security If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. diff --git a/test/integration/codebuild/buildspec.os.alpine.1.yml b/test/integration/codebuild/buildspec.os.alpine.1.yml index cd18d60..ccdc597 100644 --- a/test/integration/codebuild/buildspec.os.alpine.1.yml +++ b/test/integration/codebuild/buildspec.os.alpine.1.yml @@ -37,6 +37,14 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi - echo "Building image ${IMAGE_TAG}" - > docker build . \ diff --git a/test/integration/codebuild/buildspec.os.alpine.2.yml b/test/integration/codebuild/buildspec.os.alpine.2.yml index a165dbf..075d376 100644 --- a/test/integration/codebuild/buildspec.os.alpine.2.yml +++ b/test/integration/codebuild/buildspec.os.alpine.2.yml @@ -39,6 +39,14 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi - echo "Building image ${IMAGE_TAG}" - > docker build . \ diff --git a/test/integration/codebuild/buildspec.os.alpine.3.yml b/test/integration/codebuild/buildspec.os.alpine.3.yml index 82482d2..562c516 100644 --- a/test/integration/codebuild/buildspec.os.alpine.3.yml +++ b/test/integration/codebuild/buildspec.os.alpine.3.yml @@ -39,6 +39,14 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi - echo "Building image ${IMAGE_TAG}" - > docker build . \ diff --git a/test/integration/codebuild/buildspec.os.amazonlinux.yml b/test/integration/codebuild/buildspec.os.amazonlinux.yml index e7d2050..e620970 100644 --- a/test/integration/codebuild/buildspec.os.amazonlinux.yml +++ b/test/integration/codebuild/buildspec.os.amazonlinux.yml @@ -37,6 +37,14 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi - echo "Building image ${IMAGE_TAG}" - > docker build . \ diff --git a/test/integration/codebuild/buildspec.os.centos.1.yml b/test/integration/codebuild/buildspec.os.centos.1.yml index 329fd32..35a1465 100644 --- a/test/integration/codebuild/buildspec.os.centos.1.yml +++ b/test/integration/codebuild/buildspec.os.centos.1.yml @@ -36,6 +36,14 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi - echo "Building image ${IMAGE_TAG}" - > docker build . \ diff --git a/test/integration/codebuild/buildspec.os.centos.2.yml b/test/integration/codebuild/buildspec.os.centos.2.yml index 7755ad0..a1e247c 100644 --- a/test/integration/codebuild/buildspec.os.centos.2.yml +++ b/test/integration/codebuild/buildspec.os.centos.2.yml @@ -36,6 +36,14 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi - echo "Building image ${IMAGE_TAG}" - > docker build . \ diff --git a/test/integration/codebuild/buildspec.os.debian.yml b/test/integration/codebuild/buildspec.os.debian.yml index b5be55c..3215a72 100644 --- a/test/integration/codebuild/buildspec.os.debian.yml +++ b/test/integration/codebuild/buildspec.os.debian.yml @@ -36,6 +36,17 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi + - > + echo "RUN apt-get update && apt-get install -y curl" >> \ + "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" - echo "Building image ${IMAGE_TAG}" - > docker build . \ diff --git a/test/integration/codebuild/buildspec.os.ubuntu.1.yml b/test/integration/codebuild/buildspec.os.ubuntu.1.yml index 22f6100..4fa7536 100644 --- a/test/integration/codebuild/buildspec.os.ubuntu.1.yml +++ b/test/integration/codebuild/buildspec.os.ubuntu.1.yml @@ -35,6 +35,14 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi - echo "Building image ${IMAGE_TAG}" - > docker build . \ diff --git a/test/integration/codebuild/buildspec.os.ubuntu.2.yml b/test/integration/codebuild/buildspec.os.ubuntu.2.yml index 56834d0..33776c0 100644 --- a/test/integration/codebuild/buildspec.os.ubuntu.2.yml +++ b/test/integration/codebuild/buildspec.os.ubuntu.2.yml @@ -34,6 +34,14 @@ phases: - > echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \ "${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp" + - > + if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]]; + then + echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login." + else + echo "Performing DockerHub login . . ." + docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + fi - echo "Building image ${IMAGE_TAG}" - > docker build . \