Copilot commented on code in PR #13597:
URL: https://github.com/apache/cloudstack/pull/13597#discussion_r3578690646


##########
tools/docker/supervisord.conf:
##########
@@ -16,6 +17,7 @@ redirect_stderr=true
 user=root
 
 [program:cloudstack-ui]
+environment=NODE_OPTIONS="--openssl-legacy-provider"

Review Comment:
   `NODE_OPTIONS=--openssl-legacy-provider` is incompatible with Node.js 22+ 
(and therefore with Node.js 24 installed by the Dockerfile). With Node 24 this 
environment variable can prevent `npm run serve` from starting (Node rejects 
the flag in `NODE_OPTIONS`). Either remove this setting or downgrade Node to a 
version that still supports it (e.g., Node 20) / upgrade the UI toolchain so 
the flag is no longer needed.



##########
tools/docker/Dockerfile:
##########
@@ -61,12 +62,10 @@ RUN find /var/lib/mysql -type f -exec touch {} \; && \
     mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 
caching_sha2_password by ''" --connect-expired-password; \
     mvn -Pdeveloper -pl developer -Ddeploydb; \
     mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \
-    MARVIN_FILE=`find /root/tools/marvin/dist/ -name "Marvin*.tar.gz"`; \
-    rm -rf /usr/bin/x86_64-linux-gnu-gcc && \
-    ln -s /usr/bin/gcc-10 /usr/bin/x86_64-linux-gnu-gcc; \
-    pip3 install $MARVIN_FILE
+    MARVIN_FILE=`find /root/tools/marvin/dist/ -name "[mM]arvin*.tar.gz"`; \
+    pip3 install $MARVIN_FILE --break-system-packages

Review Comment:
   The Marvin tarball path is assigned via `find` into `MARVIN_FILE` without 
`-print -quit` and without quoting. If multiple files match (or if the path 
contains whitespace/newlines), `pip3 install` may receive multiple/invalid 
arguments. Make the selection deterministic and quote the variable.



##########
tools/docker/Dockerfile:
##########
@@ -61,12 +62,10 @@ RUN find /var/lib/mysql -type f -exec touch {} \; && \
     mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 
caching_sha2_password by ''" --connect-expired-password; \
     mvn -Pdeveloper -pl developer -Ddeploydb; \
     mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \
-    MARVIN_FILE=`find /root/tools/marvin/dist/ -name "Marvin*.tar.gz"`; \
-    rm -rf /usr/bin/x86_64-linux-gnu-gcc && \
-    ln -s /usr/bin/gcc-10 /usr/bin/x86_64-linux-gnu-gcc; \
-    pip3 install $MARVIN_FILE
+    MARVIN_FILE=`find /root/tools/marvin/dist/ -name "[mM]arvin*.tar.gz"`; \
+    pip3 install $MARVIN_FILE --break-system-packages
 
-RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -; \
+RUN curl -sL https://deb.nodesource.com/setup_24.x | sudo -E bash -; \

Review Comment:
   The Docker image installs Node.js 24, but the UI uses Vue CLI 4 / webpack 4 
(see `ui/package.json`). That toolchain often relies on 
`--openssl-legacy-provider`, which is not supported in Node 22+; this is likely 
to break UI build/serve in this image. Consider pinning Node to a compatible 
LTS (e.g., 20.x) unless you also upgrade the UI build stack to webpack 5 / Vue 
CLI 5+.



##########
tools/docker/Dockerfile:
##########
@@ -61,12 +62,10 @@ RUN find /var/lib/mysql -type f -exec touch {} \; && \
     mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH 
caching_sha2_password by ''" --connect-expired-password; \
     mvn -Pdeveloper -pl developer -Ddeploydb; \
     mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \
-    MARVIN_FILE=`find /root/tools/marvin/dist/ -name "Marvin*.tar.gz"`; \
-    rm -rf /usr/bin/x86_64-linux-gnu-gcc && \
-    ln -s /usr/bin/gcc-10 /usr/bin/x86_64-linux-gnu-gcc; \
-    pip3 install $MARVIN_FILE
+    MARVIN_FILE=`find /root/tools/marvin/dist/ -name "[mM]arvin*.tar.gz"`; \
+    pip3 install $MARVIN_FILE --break-system-packages
 
-RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -; \
+RUN curl -sL https://deb.nodesource.com/setup_24.x | sudo -E bash -; \
     apt-get install -y nodejs; \
     cd ui && npm rebuild node-sass && npm install

Review Comment:
   `npm rebuild node-sass` looks stale: `ui/package.json` does not list 
`node-sass` (it uses `sass`/`sass-loader`). Rebuilding a non-dependency can 
fail and also adds unnecessary time. Prefer a clean install from the lockfile 
for reproducible Docker builds.



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