Noob question about ARG variable

I have an issue with this dockerfile:

FROM nvidia/cuda:12.4.0-base-ubuntu22.04

# Allow passing in your host UID/GID (defaults 1000:1000)
ARG UID=1000
ARG GID=1000
#webgui service port
ARG PORT=8018

--- SNIP ---

# Expose the port that ComfyUI will use (change if needed)
EXPOSE $PORT

ENTRYPOINT ["/entrypoint.sh"]
CMD ["python","/app/ComfyUI/main.py","--listen","0.0.0.0","--port", ${PORT}]

In the last line the argument port isn’t valorized and the command fail…

Anyone with any tips ?

Did you use a long dockerfile having several FROM clause (i.e. a multi-stages Docker file). If so, you’ve to add ARG PORT again (but without the need to assign a default value), this after your FROM clause, before to use the variable.

uhm not really the source is this:

i’ll try you tweak anyway…

ARG with default values should be defined before the first FROM. In your file, it’s after. Please try to move the FROM line after

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.