Skip to content

Commit df7580c

Browse files
authored
Added 'docker login' to fix pull rate limit issue (#2)
1 parent a850fd5 commit df7580c

8 files changed

+71
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ Then,
161161
* to run integration tests: `make test-integ`
162162
* to run smoke tests: `make test-smoke`
163163

164+
### Troubleshooting
165+
166+
While running integration tests, you might encounter the Docker Hub rate limit error with the following body:
167+
```
168+
You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits
169+
```
170+
To fix the above issue, consider authenticating to a Docker Hub account by setting the Docker Hub credentials as below CodeBuild environment variables.
171+
```shell script
172+
DOCKERHUB_USERNAME=<dockerhub username>
173+
DOCKERHUB_PASSWORD=<dockerhub password>
174+
```
175+
Recommended way is to set the Docker Hub credentials in CodeBuild job by retrieving them from AWS Secrets Manager.
164176
## Security
165177

166178
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.

test/integration/codebuild/buildspec.os.alpine.1.yml

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ phases:
3838
- >
3939
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
4040
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp"
41+
- >
42+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
43+
then
44+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
45+
else
46+
echo "Performing DockerHub login . . ."
47+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
48+
fi
4149
- echo "Building image ${IMAGE_TAG}"
4250
- >
4351
docker build . \

test/integration/codebuild/buildspec.os.alpine.2.yml

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ phases:
3636
- >
3737
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
3838
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp"
39+
- >
40+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
41+
then
42+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
43+
else
44+
echo "Performing DockerHub login . . ."
45+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
46+
fi
3947
- echo "Building image ${IMAGE_TAG}"
4048
- >
4149
docker build . \

test/integration/codebuild/buildspec.os.alpine.3.yml

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ phases:
3636
- >
3737
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
3838
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp"
39+
- >
40+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
41+
then
42+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
43+
else
44+
echo "Performing DockerHub login . . ."
45+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
46+
fi
3947
- echo "Building image ${IMAGE_TAG}"
4048
- >
4149
docker build . \

test/integration/codebuild/buildspec.os.amazonlinux.yml

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ phases:
3535
- >
3636
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
3737
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp"
38+
- >
39+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
40+
then
41+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
42+
else
43+
echo "Performing DockerHub login . . ."
44+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
45+
fi
3846
- echo "Building image ${IMAGE_TAG}"
3947
- >
4048
docker build . \

test/integration/codebuild/buildspec.os.centos.yml

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ phases:
3535
- >
3636
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
3737
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp"
38+
- >
39+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
40+
then
41+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
42+
else
43+
echo "Performing DockerHub login . . ."
44+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
45+
fi
3846
- echo "Building image ${IMAGE_TAG}"
3947
- >
4048
docker build . \

test/integration/codebuild/buildspec.os.debian.yml

+11
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ phases:
3434
- >
3535
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
3636
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp"
37+
- >
38+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
39+
then
40+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
41+
else
42+
echo "Performing DockerHub login . . ."
43+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
44+
fi
45+
- >
46+
echo "RUN apt-get update && apt-get install -y curl" >> \
47+
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp"
3748
- echo "Building image ${IMAGE_TAG}"
3849
- >
3950
docker build . \

test/integration/codebuild/buildspec.os.ubuntu.yml

+8
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ phases:
3636
- >
3737
echo "COPY ${SCRATCH_DIR}/aws-lambda-rie /usr/bin/aws-lambda-rie" >> \
3838
"${SCRATCH_DIR}/Dockerfile.echo.${OS_DISTRIBUTION}.tmp"
39+
- >
40+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
41+
then
42+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
43+
else
44+
echo "Performing DockerHub login . . ."
45+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
46+
fi
3947
- echo "Building image ${IMAGE_TAG}"
4048
- >
4149
docker build . \

0 commit comments

Comments
 (0)