Skip to content

Commit

Permalink
Add note to configure the env var CNB_REGISTRY_AUTH. #95
Browse files Browse the repository at this point in the history
Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Nov 20, 2024
1 parent cb5f5a3 commit 8e783e3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,19 @@ and execute this command in a terminal:
```bash
mvn compile exec:java
```
**Important**: To avoid the `docker rate limit` error, set the following env var too
**Important**: To avoid the `docker rate limit` error, set the following env var:
```bash
export REGISTRY_USERNAME="<REGISTRY_USERNAME>"
export REGISTRY_PASSWORD="<REGISTRY_PASSWORD>"
export REGISTRY_SERVER="docker.io"
```
and also set this one to let `lifecycle` to get rid of the docker limit:
```bash
export CNB_REGISTRY_AUTH="'{"index.docker.io":"Basic <BASE64_OF_USERNAME:PASSWORD>"}'"
// Replace `<BASE64_OF_USERNAME:PASSWORD> text with
echo -n "username:password" | base64
```
### Jbang
Expand Down
9 changes: 8 additions & 1 deletion samples/build-me/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,16 @@ and execute this command in a terminal:
mvn compile exec:java
```

**Important**: To avoid the `docker rate limit` error, set the following env var too
**Important**: To avoid the `docker rate limit` error, set the following env var:
```bash
export REGISTRY_USERNAME="<REGISTRY_USERNAME>"
export REGISTRY_PASSWORD="<REGISTRY_PASSWORD>"
export REGISTRY_SERVER="docker.io"
```
and also set this one to let `lifecycle` to get rid of the docker limit:
```bash
export CNB_REGISTRY_AUTH="'{"index.docker.io":"Basic <BASE64_OF_USERNAME:PASSWORD>"}'"

// Replace `<BASE64_OF_USERNAME:PASSWORD> text with
echo -n "username:password" | base64
```
3 changes: 2 additions & 1 deletion samples/build-me/src/main/java/dev/snowdrop/BuildMe.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ public static void main(String... args) {

Map<String, String> envMap = new HashMap<>();
envMap.put("BP_JVM_VERSION", "21");
envMap.put("CNB_REGISTRY_AUTH",System.getenv("CNB_REGISTRY_AUTH"));
// envMap.put("CNB_LOG_LEVEL","debug");
// envMap.put("BP_MAVEN_BUILT_ARTIFACT","target/quarkus-app/lib/ target/quarkus-app/*.jar target/quarkus-app/app/ target/quarkus-app/quarkus");
// envMap.put("CNB_LOG_LEVEL","trace");

DockerClient client = getDockerClient();
client.authConfig()
Expand Down

0 comments on commit 8e783e3

Please sign in to comment.