Thank you, it worked. Basically I set up an ENV DFXVM_INIT_YES=true
before calling the RUN curl -fsSL https://internetcomputer.org/install.sh | sh
and it proceeds to install successfully.
ENV DFXVM_INIT_YES=true
RUN curl -fsSL https://internetcomputer.org/install.sh | sh
And manually add dfxPath = ‘/root/.local/share/dfx/bin’; to the envs interacting with the dfx cli.