From 2a47b970762cdc35d7a05ec41ecfeb834d045a0f Mon Sep 17 00:00:00 2001 From: vsevel Date: Thu, 6 Jun 2024 14:02:37 +0200 Subject: [PATCH] Remote Development Mode docker permissions --- docs/src/main/asciidoc/gradle-tooling.adoc | 2 +- docs/src/main/asciidoc/maven-tooling.adoc | 4 ++-- .../deployment/src/test/resources/ubi8-openjdk-17-runtime | 4 ++++ .../deployment/src/test/resources/ubi8-openjdk-21-runtime | 4 ++++ .../deployment/src/test/resources/ubi9-openjdk-17-runtime | 4 ++++ .../deployment/src/test/resources/ubi9-openjdk-21-runtime | 4 ++++ .../tooling/dockerfiles/base/Dockerfile-layout.include.qute | 4 ++++ 7 files changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/src/main/asciidoc/gradle-tooling.adoc b/docs/src/main/asciidoc/gradle-tooling.adoc index 7871b6a2729e7..d5d77bd2521db 100644 --- a/docs/src/main/asciidoc/gradle-tooling.adoc +++ b/docs/src/main/asciidoc/gradle-tooling.adoc @@ -294,7 +294,7 @@ Before you start Quarkus on the remote host set the environment variable `QUARKU on bare metal you can set it via the `export QUARKUS_LAUNCH_DEVMODE=true` command and then run the application with the proper `java -jar ...` command to run the application. If you plan on running the application via Docker, then you'll need to add `-e QUARKUS_LAUNCH_DEVMODE=true` to the `docker run` command. -When the application starts you should now see the following line in the logs: `Profile dev activated. Live Coding activated`. +When the application starts you should now see the following line in the logs: `Profile dev activated. Live Coding activated`. You will also need to give the application the rights to update the deployment resources by adding `RUN chmod o+rw -R /deployments` after the `COPY` commands into your docker file. NOTE: The remote side does not need to include Maven or any other development tools. The normal `fast-jar` Dockerfile diff --git a/docs/src/main/asciidoc/maven-tooling.adoc b/docs/src/main/asciidoc/maven-tooling.adoc index bc6eb6b1d822c..7f917a072f17d 100644 --- a/docs/src/main/asciidoc/maven-tooling.adoc +++ b/docs/src/main/asciidoc/maven-tooling.adoc @@ -238,8 +238,8 @@ include::{includes}/devtools/build.adoc[] Before you start Quarkus on the remote host set the environment variable `QUARKUS_LAUNCH_DEVMODE=true`. If you are on bare metal you can set it via the `export QUARKUS_LAUNCH_DEVMODE=true` command and then run the application with the proper `java -jar ...` command to run the application. -If you plan on running the application via Docker, then you'll need to add `-e QUARKUS_LAUNCH_DEVMODE=true` to the `docker run` command. -When the application starts you should now see the following line in the logs: `Profile dev activated. Live Coding activated`. +If you plan on running the application via Docker, then you'll need to add `-e QUARKUS_LAUNCH_DEVMODE=true` to the `docker run` command. +When the application starts you should now see the following line in the logs: `Profile dev activated. Live Coding activated`. You will also need to give the application the rights to update the deployment resources by adding `RUN chmod o+rw -R /deployments` after the `COPY` commands into your docker file. NOTE: The remote side does not need to include Maven or any other development tools. The normal `fast-jar` Dockerfile that is generated with a new Quarkus application is all you need. If you are using bare metal launch the Quarkus runner diff --git a/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-17-runtime b/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-17-runtime index a06add4a4733e..6ccfaebae6b41 100644 --- a/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-17-runtime +++ b/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-17-runtime @@ -11,6 +11,10 @@ COPY --chown=185 target/quarkus-app/*.jar /deployments/ COPY --chown=185 target/quarkus-app/app/ /deployments/app/ COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ +# Remote Development Mode; do not uncomment if building prod container +# ENV QUARKUS_LAUNCH_DEVMODE=true +# RUN chmod o+rw -R /deployments + EXPOSE 8080 USER 185 diff --git a/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-21-runtime b/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-21-runtime index 0a470b183b8da..07dc6f24468ca 100644 --- a/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-21-runtime +++ b/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi8-openjdk-21-runtime @@ -12,6 +12,10 @@ COPY --chown=185 target/quarkus-app/*.jar /deployments/ COPY --chown=185 target/quarkus-app/app/ /deployments/app/ COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ +# Remote Development Mode; do not uncomment if building prod container +# ENV QUARKUS_LAUNCH_DEVMODE=true +# RUN chmod o+rw -R /deployments + EXPOSE 8080 USER 185 diff --git a/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-17-runtime b/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-17-runtime index bc09884236f94..37843b62d0d4b 100644 --- a/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-17-runtime +++ b/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-17-runtime @@ -11,6 +11,10 @@ COPY --chown=185 target/quarkus-app/*.jar /deployments/ COPY --chown=185 target/quarkus-app/app/ /deployments/app/ COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ +# Remote Development Mode; do not uncomment if building prod container +# ENV QUARKUS_LAUNCH_DEVMODE=true +# RUN chmod o+rw -R /deployments + EXPOSE 8080 USER 185 diff --git a/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-21-runtime b/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-21-runtime index d50d434412196..67b421556e528 100644 --- a/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-21-runtime +++ b/extensions/container-image/container-image-docker-common/deployment/src/test/resources/ubi9-openjdk-21-runtime @@ -12,6 +12,10 @@ COPY --chown=185 target/quarkus-app/*.jar /deployments/ COPY --chown=185 target/quarkus-app/app/ /deployments/app/ COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ +# Remote Development Mode; do not uncomment if building prod container +# ENV QUARKUS_LAUNCH_DEVMODE=true +# RUN chmod o+rw -R /deployments + EXPOSE 8080 USER 185 diff --git a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/Dockerfile-layout.include.qute b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/Dockerfile-layout.include.qute index 286a7757dbc7c..8a3a99cbc9bb4 100644 --- a/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/Dockerfile-layout.include.qute +++ b/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/tooling/dockerfiles/base/Dockerfile-layout.include.qute @@ -83,6 +83,10 @@ ENV LANGUAGE='en_US:en' {#insert copy /} +# Remote Development Mode; do not uncomment if building prod container +# ENV QUARKUS_LAUNCH_DEVMODE=true +# RUN chmod o+rw -R /deployments + EXPOSE 8080 USER 185 {#if java.version == '11'}