Skip to content

Added 'docker login' to fix pull rate limit issue #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions aws-lambda-java-runtime-interface-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,18 @@ This command invokes the function running in the container image and returns a r

*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).*

### 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 username>
DOCKERHUB_PASSWORD=<dockerhub password>
```
Recommended way is to set the Docker Hub credentials in CodeBuild job by retrieving them from AWS Secrets Manager.

## Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ batch:
RUNTIME_VERSION:
- "corretto11"
phases:
install:
commands:
- >
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
pre_build:
commands:
- (cd aws-lambda-java-serialization && mvn install)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ batch:
- "8"
- "11"
phases:
install:
commands:
- >
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
pre_build:
commands:
- (cd aws-lambda-java-serialization && mvn install)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ batch:
RUNTIME_VERSION:
- "openjdk8"
phases:
install:
commands:
- >
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
pre_build:
commands:
- (cd aws-lambda-java-serialization && mvn install)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ batch:
RUNTIME_VERSION:
- "corretto11"
phases:
install:
commands:
- >
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
pre_build:
commands:
- (cd aws-lambda-java-serialization && mvn install)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ batch:
RUNTIME_VERSION:
- "corretto11"
phases:
install:
commands:
- >
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
pre_build:
commands:
- (cd aws-lambda-java-serialization && mvn install)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ batch:
RUNTIME_VERSION:
- "corretto11"
phases:
install:
commands:
- >
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
pre_build:
commands:
- (cd aws-lambda-java-serialization && mvn install)
Expand Down