You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by GitBox <gi...@apache.org> on 2020/09/17 07:12:55 UTC

[GitHub] [karaf] jbonofre commented on a change in pull request #1190: Feature/optimize docker script and update docs

jbonofre commented on a change in pull request #1190:
URL: https://github.com/apache/karaf/pull/1190#discussion_r490019075



##########
File path: assemblies/docker/README.md
##########
@@ -33,30 +33,63 @@ On macOS, an easy way to install `buildx` is to install [Docker Desktop Edge](ht
 ## Build
 
 Images are based on the Docker official [AdoptOpenJDK 11 JRE Hotspot](https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=11-jre-hotspot) image. If you want to
-build the Karaf image run:
+build the Karaf image you have the following choices:
 
-```
-sh build.sh
+1. Create the docker image from the SNAPSHOT version (from local distribution)
+2. Create the docker image from an Apache Karaf archive, for example (apache-karaf-4.2.9.tar.gz)
+3. Create the docker image from a specific version of Apache Karaf

Review comment:
       I would add remote or local custom Karaf distribution.

##########
File path: assemblies/docker/README.md
##########
@@ -33,30 +33,63 @@ On macOS, an easy way to install `buildx` is to install [Docker Desktop Edge](ht
 ## Build
 
 Images are based on the Docker official [AdoptOpenJDK 11 JRE Hotspot](https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=11-jre-hotspot) image. If you want to
-build the Karaf image run:
+build the Karaf image you have the following choices:
 
-```
-sh build.sh
+1. Create the docker image from the SNAPSHOT version (from local distribution)

Review comment:
       That's not accurate: local distribution is not necessary SNAPSHOT. It could be a custom distribution locally built (like on CI). I would change this with:
   
   `1. Create the docker image from a local distribution package`

##########
File path: assemblies/docker/README.md
##########
@@ -33,30 +33,63 @@ On macOS, an easy way to install `buildx` is to install [Docker Desktop Edge](ht
 ## Build
 
 Images are based on the Docker official [AdoptOpenJDK 11 JRE Hotspot](https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=11-jre-hotspot) image. If you want to
-build the Karaf image run:
+build the Karaf image you have the following choices:
 
-```
-sh build.sh
+1. Create the docker image from the SNAPSHOT version (from local distribution)
+2. Create the docker image from an Apache Karaf archive, for example (apache-karaf-4.2.9.tar.gz)
+3. Create the docker image from a specific version of Apache Karaf
+
+If you run `build.sh` without arguments then you could see how to usage this command.
+
+```bash
+Usage:
+  build.sh --from-local-dist [--archive <archive>] [--image-name <image>] [--build-multi-platform <comma-separated platforms>]
+  build.sh --from-release --karaf-version <x.x.x> [--image-name <image>] [--build-multi-platform <comma-separated platforms>]
+  build.sh --help
+
+  If the --image-name flag is not used the built image name will be 'karaf'.
+  Check the supported build platforms; you can verify with this command: docker buildx ls
+  The supported platforms (OS/Arch) depend on the build's base image, in this case [adoptopenjdk:11-jre-hotspot](https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=11-jre-hotspot).
 ```
 
-or
+To create the docker image from the SNAPSHOT version (from local distribution) 
+you can execute the command below. Remember that before you can successfully run 
+this command, you must build the project 
+(for example with the command `mvn clean install -DskipTests`). For more info
+you can read: [Building Apache Karaf](https://github.com/apache/karaf/blob/master/BUILDING.md#building-apache-karaf)
 
+```bash
+./build.sh --from-local-dist
 ```
-docker build -t karaf .
+
+For create the docker image from the local dist version but with the archive,
+you can execute the below command. Remember that before you can successfully run 
+this command.
+
+```bash
+./build.sh --from-local-dist --archive ~/home/amusarra/apache-karaf-4.2.9.tar.gz
 ```
 
-If you want to build the container for a specific version of Karaf
-you can configure it with the `KARAF_VERSION` arg:
+You can also specify the image name with the `--image-name` flag, for example
+(replacing the version, image name, and targets as appropriate):
 
+```bash
+./build.sh --from-local-dist --archive ~/Downloads/apache-karaf-4.2.9.tar.gz --image-name amusarra/karaf:4.2.9-dev

Review comment:
       Please don't use user specific setup. I would change to something like:
   
   `--image-name myrepo/mykaraf:x.x.x`
   
   to be generic.

##########
File path: assemblies/docker/README.md
##########
@@ -33,30 +33,63 @@ On macOS, an easy way to install `buildx` is to install [Docker Desktop Edge](ht
 ## Build
 
 Images are based on the Docker official [AdoptOpenJDK 11 JRE Hotspot](https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=11-jre-hotspot) image. If you want to
-build the Karaf image run:
+build the Karaf image you have the following choices:
 
-```
-sh build.sh
+1. Create the docker image from the SNAPSHOT version (from local distribution)
+2. Create the docker image from an Apache Karaf archive, for example (apache-karaf-4.2.9.tar.gz)
+3. Create the docker image from a specific version of Apache Karaf
+
+If you run `build.sh` without arguments then you could see how to usage this command.
+
+```bash
+Usage:
+  build.sh --from-local-dist [--archive <archive>] [--image-name <image>] [--build-multi-platform <comma-separated platforms>]
+  build.sh --from-release --karaf-version <x.x.x> [--image-name <image>] [--build-multi-platform <comma-separated platforms>]
+  build.sh --help
+
+  If the --image-name flag is not used the built image name will be 'karaf'.
+  Check the supported build platforms; you can verify with this command: docker buildx ls
+  The supported platforms (OS/Arch) depend on the build's base image, in this case [adoptopenjdk:11-jre-hotspot](https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=11-jre-hotspot).
 ```
 
-or
+To create the docker image from the SNAPSHOT version (from local distribution) 
+you can execute the command below. Remember that before you can successfully run 
+this command, you must build the project 
+(for example with the command `mvn clean install -DskipTests`). For more info
+you can read: [Building Apache Karaf](https://github.com/apache/karaf/blob/master/BUILDING.md#building-apache-karaf)
 
+```bash
+./build.sh --from-local-dist
 ```
-docker build -t karaf .
+
+For create the docker image from the local dist version but with the archive,
+you can execute the below command. Remember that before you can successfully run 
+this command.
+
+```bash
+./build.sh --from-local-dist --archive ~/home/amusarra/apache-karaf-4.2.9.tar.gz
 ```
 
-If you want to build the container for a specific version of Karaf
-you can configure it with the `KARAF_VERSION` arg:
+You can also specify the image name with the `--image-name` flag, for example
+(replacing the version, image name, and targets as appropriate):
 
+```bash
+./build.sh --from-local-dist --archive ~/Downloads/apache-karaf-4.2.9.tar.gz --image-name amusarra/karaf:4.2.9-dev
 ```
-docker build --build-arg KARAF_VERSION=4.2.0 -t "karaf:4.2.0" karaf
+
+If you want to build the docker image for a specific version of Karaf
+you can run `build.sh` command in this way (replacing the version, image name, 
+and targets as appropriate):
+
+```bash
+./build.sh --from-release --karaf-version 4.2.9 --image-name amusarra/karaf:4.2.9

Review comment:
       Same here: please avoid specific user content (basically replace amusarra with myrepo for instance).

##########
File path: assemblies/docker/README.md
##########
@@ -33,30 +33,63 @@ On macOS, an easy way to install `buildx` is to install [Docker Desktop Edge](ht
 ## Build
 
 Images are based on the Docker official [AdoptOpenJDK 11 JRE Hotspot](https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=11-jre-hotspot) image. If you want to
-build the Karaf image run:
+build the Karaf image you have the following choices:
 
-```
-sh build.sh
+1. Create the docker image from the SNAPSHOT version (from local distribution)
+2. Create the docker image from an Apache Karaf archive, for example (apache-karaf-4.2.9.tar.gz)
+3. Create the docker image from a specific version of Apache Karaf
+
+If you run `build.sh` without arguments then you could see how to usage this command.
+
+```bash
+Usage:
+  build.sh --from-local-dist [--archive <archive>] [--image-name <image>] [--build-multi-platform <comma-separated platforms>]
+  build.sh --from-release --karaf-version <x.x.x> [--image-name <image>] [--build-multi-platform <comma-separated platforms>]
+  build.sh --help
+
+  If the --image-name flag is not used the built image name will be 'karaf'.
+  Check the supported build platforms; you can verify with this command: docker buildx ls
+  The supported platforms (OS/Arch) depend on the build's base image, in this case [adoptopenjdk:11-jre-hotspot](https://hub.docker.com/_/adoptopenjdk?tab=tags&page=1&name=11-jre-hotspot).
 ```
 
-or
+To create the docker image from the SNAPSHOT version (from local distribution) 

Review comment:
       I would remove this paragraph. It could be confusing for users.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org