You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/07/16 00:53:10 UTC

[PR] Fix unexpanded LOCAL_PATH in Proxy Native Dockerfile ENTRYPOINT [shardingsphere]

thswlsqls opened a new pull request, #39146:
URL: https://github.com/apache/shardingsphere/pull/39146

   Fixes #39143.
   
   Changes proposed in this pull request:
     - Replace the exec-form `ENTRYPOINT` `${LOCAL_PATH}` references with the literal `/opt/shardingsphere-proxy` in all three Proxy Native Dockerfiles (`Dockerfile-linux-dynamic`, `Dockerfile-linux-mostly`, `Dockerfile-linux-static`).
     - Reason: Docker exec form (JSON array) invokes no shell, so `${LOCAL_PATH}` was never expanded; the container exec'd the literal path and failed to start. `COPY` expands it, so images built/pushed fine and CI never runs the container, keeping the bug latent.
     - The literal is provably equivalent: `LOCAL_PATH` is `ENV LOCAL_PATH=/opt/shardingsphere-proxy` (not `ARG`), so it cannot be overridden by `--build-arg`; the pom's `docker.build/push.native.linux` executions pass only `PROJECT_VERSION`. The value always matches the `COPY --from=nativebuild ... ${LOCAL_PATH}` destination.
     - Exec form is kept for correct PID-1 signal handling. Shell-form is not an option because the base images (`gcr.io/distroless/*`, `scratch`) have no shell; the sibling `distribution/proxy/Dockerfile` uses shell-form only because its `eclipse-temurin` base has one. Backward-compatible: only repairs broken startup.
     - Verification is static plus Docker-runtime only; this module is `packaging=pom` with no Java sources.
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `./mvnw spotless:check checkstyle:check apache-rat:check -Pcheck -T1C -pl distribution/proxy-native` (module is `packaging=pom`; full `install` triggers the GraalVM native build, not run locally).
   - [ ] I have made corresponding changes to the documentation.
   - [ ] No unit tests: `distribution/proxy-native` is a packaging-only (`pom`) module with no Java sources; a Dockerfile `ENTRYPOINT` is only exercisable at Docker runtime, not by `./mvnw ... test`.
   - [x] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
   
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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


Re: [PR] Fix unexpanded LOCAL_PATH in Proxy Native Dockerfile ENTRYPOINT [shardingsphere]

Posted by "thswlsqls (via GitHub)" <gi...@apache.org>.
thswlsqls commented on PR #39146:
URL: https://github.com/apache/shardingsphere/pull/39146#issuecomment-5030851622

   Thanks for the review. You're right — keeping `ENV LOCAL_PATH` left the install path with two independent representations. Dropped `ENV LOCAL_PATH` from all three Dockerfiles; `COPY` and `ENTRYPOINT` now use the absolute `/opt/shardingsphere-proxy` directly.
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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


Re: [PR] Fix unexpanded LOCAL_PATH in Proxy Native Dockerfile ENTRYPOINT [shardingsphere]

Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on code in PR #39146:
URL: https://github.com/apache/shardingsphere/pull/39146#discussion_r3594405025


##########
distribution/proxy-native/Dockerfile-linux-dynamic:
##########
@@ -25,4 +25,4 @@ LABEL org.opencontainers.image.authors="ShardingSphere dev@shardingsphere.apache
 ENV LOCAL_PATH=/opt/shardingsphere-proxy
 ARG PROJECT_VERSION
 COPY --from=nativebuild /build/distribution/proxy-native/target/apache-shardingsphere-${PROJECT_VERSION}-shardingsphere-proxy-bin ${LOCAL_PATH}
-ENTRYPOINT ["${LOCAL_PATH}/bin/shardingsphere-proxy-native", "3307", "${LOCAL_PATH}/conf", "0.0.0.0"]
+ENTRYPOINT ["/opt/shardingsphere-proxy/bin/shardingsphere-proxy-native", "3307", "/opt/shardingsphere-proxy/conf", "0.0.0.0"]

Review Comment:
   I’ve somewhat forgotten the initial details; after all, for a long time, GraalVM Native Image could only be debugged using GDB, and support for debugging it via JDWP has only arrived within the last year.
   
   So, why didn't you go ahead and remove the `ENV LOCAL_PATH=/opt/shardingsphere-proxy` definition as well?



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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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


Re: [PR] Fix unexpanded LOCAL_PATH in Proxy Native Dockerfile ENTRYPOINT [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu merged PR #39146:
URL: https://github.com/apache/shardingsphere/pull/39146


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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