diff --git a/README.md b/README.md index 835690c..61627b0 100644 --- a/README.md +++ b/README.md @@ -218,28 +218,31 @@ If the build fails for any reason, a `BuildpackException` will be thrown, this i To play with the Java Buildpack client & DSL, use the following simple java project: [samples/build-me](samples/build-me) -To use it, just configure the following env var pointing to a project to be built as a container image +To use it, configure the following mandatory environment variables pointing to a project (example: [hello-quarkus](samples/hello-quarkus), [hello-spring](samples/hello-spring)) to be built as a container image ```bash export PROJECT_PATH= -export IMAGE_REF= // quay.io// or +export IMAGE_REF= // without registry or // ``` -and execute this command in a terminal: + +**Important**: To avoid the `docker rate limit` problem, then set this `CNB_` environment variable to let `lifecycle` to get rid of the limit: ```bash -mvn compile exec:java +export CNB_REGISTRY_AUTH="'{"index.docker.io":"Basic "}'" + +// Replace ` text with +echo -n "username:password" | base64 ``` -**Important**: To avoid the `docker rate limit` error, set the following env var: + +If you plan to push your image to a registry, then set your registry credential using these variables: ```bash export REGISTRY_USERNAME="" export 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 "}'" -// Replace ` text with -echo -n "username:password" | base64 +Execute this command in a terminal: +```bash +mvn compile exec:java ``` ### Jbang diff --git a/samples/build-me/README.md b/samples/build-me/README.md index b18259f..a2e6e4a 100644 --- a/samples/build-me/README.md +++ b/samples/build-me/README.md @@ -3,27 +3,29 @@ Example of a java project able to build a Quarkus, Spring Boot, ... project using the DSL `BuildConfig.builder()` -To use it, just configure the following env var pointing to a project to be built as a container image +To use it, configure the following mandatory environment variables pointing to a project (example: [hello-quarkus](../hello-quarkus), [hello-spring](../hello-spring)) to be built as a container image ```bash export PROJECT_PATH= -export IMAGE_REF= // quay.io// or +export IMAGE_REF= // without registry or // ``` -and execute this command in a terminal: + +**Important**: To avoid the `docker rate limit` problem, then set this `CNB_` environment variable to let `lifecycle` to get rid of the limit: ```bash -mvn compile exec:java +export CNB_REGISTRY_AUTH="'{"index.docker.io":"Basic "}'" + +// Replace ` text with +echo -n "username:password" | base64 ``` -**Important**: To avoid the `docker rate limit` error, set the following env var: +If you plan to push your image to a registry, then set your registry credential using these variables: ```bash export REGISTRY_USERNAME="" export 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 "}'" -// Replace ` text with -echo -n "username:password" | base64 +Execute this command in a terminal: +```bash +mvn compile exec:java ``` \ No newline at end of file diff --git a/samples/build-me/src/main/java/dev/snowdrop/BuildMe.java b/samples/build-me/src/main/java/dev/snowdrop/BuildMe.java index abf067b..3b776a0 100644 --- a/samples/build-me/src/main/java/dev/snowdrop/BuildMe.java +++ b/samples/build-me/src/main/java/dev/snowdrop/BuildMe.java @@ -23,7 +23,6 @@ public static void main(String... args) { String REGISTRY_PASSWORD = System.getenv("REGISTRY_PASSWORD"); String REGISTRY_SERVER = System.getenv("REGISTRY_SERVER"); String IMAGE_REF = System.getenv("IMAGE_REF"); - String PROJECT_PATH = System.getenv("PROJECT_PATH"); Map envMap = new HashMap<>();