Skip to content

Commit c247f11

Browse files
stefanbotezStefan Botezcarlzogh
authored
Added 'docker login' to fix pull rate limit issue (#197)
Added 'docker login' to fix pull rate limit issue Co-authored-by: Stefan Botez <[email protected]> Co-authored-by: Carl Zogheib <[email protected]>
1 parent 334a5aa commit c247f11

File tree

7 files changed

+72
-0
lines changed

7 files changed

+72
-0
lines changed

aws-lambda-java-runtime-interface-client/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,18 @@ This command invokes the function running in the container image and returns a r
120120

121121
*Alternately, you can also include RIE as a part of your base image. See the AWS documentation on how to [Build RIE into your base image](https://docs.aws.amazon.com/lambda/latest/dg/images-test.html#images-test-alternative).*
122122

123+
### Troubleshooting
124+
125+
While running integration tests, you might encounter the Docker Hub rate limit error with the following body:
126+
```
127+
You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limits
128+
```
129+
To fix the above issue, consider authenticating to a Docker Hub account by setting the Docker Hub credentials as below CodeBuild environment variables.
130+
```shell script
131+
DOCKERHUB_USERNAME=<dockerhub username>
132+
DOCKERHUB_PASSWORD=<dockerhub password>
133+
```
134+
Recommended way is to set the Docker Hub credentials in CodeBuild job by retrieving them from AWS Secrets Manager.
123135

124136
## Security
125137

aws-lambda-java-runtime-interface-client/test/integration/codebuild/buildspec.os.alpine.yml

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ batch:
2222
RUNTIME_VERSION:
2323
- "corretto11"
2424
phases:
25+
install:
26+
commands:
27+
- >
28+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
29+
then
30+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
31+
else
32+
echo "Performing DockerHub login . . ."
33+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
34+
fi
2535
pre_build:
2636
commands:
2737
- (cd aws-lambda-java-serialization && mvn install)

aws-lambda-java-runtime-interface-client/test/integration/codebuild/buildspec.os.amazoncorretto.yml

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ batch:
2020
- "8"
2121
- "11"
2222
phases:
23+
install:
24+
commands:
25+
- >
26+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
27+
then
28+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
29+
else
30+
echo "Performing DockerHub login . . ."
31+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
32+
fi
2333
pre_build:
2434
commands:
2535
- (cd aws-lambda-java-serialization && mvn install)

aws-lambda-java-runtime-interface-client/test/integration/codebuild/buildspec.os.amazonlinux.yml

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ batch:
2020
RUNTIME_VERSION:
2121
- "openjdk8"
2222
phases:
23+
install:
24+
commands:
25+
- >
26+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
27+
then
28+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
29+
else
30+
echo "Performing DockerHub login . . ."
31+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
32+
fi
2333
pre_build:
2434
commands:
2535
- (cd aws-lambda-java-serialization && mvn install)

aws-lambda-java-runtime-interface-client/test/integration/codebuild/buildspec.os.centos.yml

+10
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ batch:
2020
RUNTIME_VERSION:
2121
- "corretto11"
2222
phases:
23+
install:
24+
commands:
25+
- >
26+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
27+
then
28+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
29+
else
30+
echo "Performing DockerHub login . . ."
31+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
32+
fi
2333
pre_build:
2434
commands:
2535
- (cd aws-lambda-java-serialization && mvn install)

aws-lambda-java-runtime-interface-client/test/integration/codebuild/buildspec.os.debian.yml

+10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ batch:
1919
RUNTIME_VERSION:
2020
- "corretto11"
2121
phases:
22+
install:
23+
commands:
24+
- >
25+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
26+
then
27+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
28+
else
29+
echo "Performing DockerHub login . . ."
30+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
31+
fi
2232
pre_build:
2333
commands:
2434
- (cd aws-lambda-java-serialization && mvn install)

aws-lambda-java-runtime-interface-client/test/integration/codebuild/buildspec.os.ubuntu.yml

+10
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ batch:
2121
RUNTIME_VERSION:
2222
- "corretto11"
2323
phases:
24+
install:
25+
commands:
26+
- >
27+
if [[ -z "${DOCKERHUB_USERNAME}" && -z "${DOCKERHUB_PASSWORD}" ]];
28+
then
29+
echo "DockerHub credentials not set as CodeBuild environment variables. Continuing without docker login."
30+
else
31+
echo "Performing DockerHub login . . ."
32+
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
33+
fi
2434
pre_build:
2535
commands:
2636
- (cd aws-lambda-java-serialization && mvn install)

0 commit comments

Comments
 (0)