Copilot commented on code in PR #2252:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2252#discussion_r3903232226


##########
minifi_rust/minifi_rs_behave/Dockerfile.debian:
##########
@@ -22,4 +22,4 @@ RUN cargo build --release
 
 # Export Stage
 FROM scratch AS bin-export
-COPY --from=builder /app/target/release/libminifi_rs_playground.so /
+COPY --from=builder /app/target/release/libminifi*.so /

Review Comment:
   Using a wildcard in `COPY` can make the image contents non-deterministic and 
can also break builds if the glob matches 0 files (Docker treats that as an 
error). Consider copying the exact expected artifact name, or copying into a 
directory (e.g., `/`) with a deterministic filename (or use a build arg to 
select the intended `.so`).



##########
minifi_rust/minifi_rs_behave/Dockerfile.alpine:
##########
@@ -22,4 +22,4 @@ RUN cargo build --release
 
 # Export Stage
 FROM scratch AS bin-export
-COPY --from=builder /app/target/release/libminifi_rs_playground.so /
+COPY --from=builder /app/target/release/libminifi*.so /

Review Comment:
   Same issue as Debian: wildcard `COPY` can fail if no files match and can 
unintentionally export multiple `.so` files if more get produced in the future. 
Prefer copying a single, explicit output or parameterize the artifact name so 
the export stage remains deterministic.



##########
minifi_rust/minifi_rs_behave/Dockerfile.debian:
##########
@@ -22,4 +22,4 @@ RUN cargo build --release
 
 # Export Stage
 FROM scratch AS bin-export
-COPY --from=builder /app/target/release/libminifi_rs_playground.so /
+COPY --from=builder /app/target/release/libminifi*.so /

Review Comment:
   The PR title/description focuses on fixing Rocky 9 package verification, but 
this PR also changes Rust behave Docker export behavior. Please either (a) 
update the PR description to explain why the Rust Dockerfile changes are 
required for the same issue, or (b) split the Rust Dockerfile changes into a 
separate PR to keep the scope aligned.



##########
cmake/VerifyPackageWithDocker.cmake:
##########
@@ -39,16 +39,16 @@ function(ADD_PACKAGE_VERIFY TAG_PREFIX)
 endfunction()
 
 
-CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux:8 rocky8 "dnf install -y 
wget python3.12-devel python3.12-pip gcc gcc-c++ findutils libatomic")
-CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux:9 rocky9 "dnf install -y 
wget python3-devel python3-pip gcc gcc-c++ findutils libatomic")
+CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux:8 rocky8 "dnf install -y 
wget python3.12-devel python3.12-pip gcc gcc-c++ findutils libatomic \\&\\& 
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 \\&\\& 
alternatives --set python3 /usr/bin/python3.12")
+CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux:9 rocky9 "dnf install -y 
wget python3.12-devel python3.12-pip gcc gcc-c++ findutils libatomic \\&\\& 
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 \\&\\& 
alternatives --set python3 /usr/bin/python3.12")

Review Comment:
   `alternatives` may not be present in the minimal `rockylinux:8/9` images by 
default (on RHEL-like distros it is commonly provided by the `chkconfig` 
package). If `alternatives` is missing, these docker targets will fail at 
runtime. Fix by installing the package that provides `alternatives` (e.g., add 
`chkconfig` to the `dnf install` list) or avoid `alternatives` entirely and use 
an explicit symlink/command invocation strategy that doesn't depend on that 
tool.



##########
cmake/VerifyPackageWithDocker.cmake:
##########
@@ -39,16 +39,16 @@ function(ADD_PACKAGE_VERIFY TAG_PREFIX)
 endfunction()
 
 
-CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux:8 rocky8 "dnf install -y 
wget python3.12-devel python3.12-pip gcc gcc-c++ findutils libatomic")
-CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux:9 rocky9 "dnf install -y 
wget python3-devel python3-pip gcc gcc-c++ findutils libatomic")
+CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux:8 rocky8 "dnf install -y 
wget python3.12-devel python3.12-pip gcc gcc-c++ findutils libatomic \\&\\& 
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 \\&\\& 
alternatives --set python3 /usr/bin/python3.12")
+CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux:9 rocky9 "dnf install -y 
wget python3.12-devel python3.12-pip gcc gcc-c++ findutils libatomic \\&\\& 
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 \\&\\& 
alternatives --set python3 /usr/bin/python3.12")
 CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(rockylinux/rockylinux:10 rocky10 "dnf 
install -y wget python3-devel python3-pip gcc gcc-c++ findutils libatomic")
 CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(ubuntu:jammy jammy "apt update \\&\\& 
apt install -y wget python3-dev python3-venv python3-pip")
 CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(ubuntu:noble noble "apt update \\&\\& 
apt install -y wget python3-dev python3-venv python3-pip")
 CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(debian:bookworm bookworm "apt update 
\\&\\& apt install -y wget python3-dev python3-venv python3-pip")
 CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(debian:bullseye bullseye "apt update 
\\&\\& apt install -y wget python3-dev python3-venv python3-pip")
 CREATE_DOCKER_TARGET_FROM_ROCKY_PACKAGE(debian:trixie trixie "apt update 
\\&\\& apt install -y wget python3-dev python3-venv python3-pip")
-CREATE_DOCKER_TARGET_FROM_RPM_PACKAGE(rockylinux:8 rocky8 "dnf install -y wget 
python3.12-devel python3.12-pip gcc gcc-c++ libatomic")
-CREATE_DOCKER_TARGET_FROM_RPM_PACKAGE(rockylinux:9 rocky9 "dnf install -y wget 
python3-devel python3-pip gcc gcc-c++ libatomic")
+CREATE_DOCKER_TARGET_FROM_RPM_PACKAGE(rockylinux:8 rocky8 "dnf install -y wget 
python3.12-devel python3.12-pip gcc gcc-c++ findutils libatomic \\&\\& 
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 \\&\\& 
alternatives --set python3 /usr/bin/python3.12")
+CREATE_DOCKER_TARGET_FROM_RPM_PACKAGE(rockylinux:9 rocky9 "dnf install -y wget 
python3.12-devel python3.12-pip gcc gcc-c++ findutils libatomic \\&\\& 
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 \\&\\& 
alternatives --set python3 /usr/bin/python3.12")

Review Comment:
   `alternatives` may not be present in the minimal `rockylinux:8/9` images by 
default (on RHEL-like distros it is commonly provided by the `chkconfig` 
package). If `alternatives` is missing, these docker targets will fail at 
runtime. Fix by installing the package that provides `alternatives` (e.g., add 
`chkconfig` to the `dnf install` list) or avoid `alternatives` entirely and use 
an explicit symlink/command invocation strategy that doesn't depend on that 
tool.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to