How can I suppress the output of the RUN command in a Dockerfile? In the code below, I'm attempting to redirect the SSH_PRIVATE_KEY to a file using the echo command. However, during image building, the Docker logs reveal the SSH PRIVATE KEY, which I'd like to avoid. Is there a way to silence the RUN command in a Dockerfile, or is there another solution to this issue?
RUN echo "${SSH_PRIVATE_KEY}" > /home/$USER/.ssh/id_ed25519
Build log
=> CACHED [app 10/19] RUN echo "-----BEGIN OPENSSH PRIVATE KEY-----0s9 0.0s
ARGor otherwise supply them to the build process.RUN bash -c 'echo "${SSH_PRIVATE_KEY}" > /home/$USER/.ssh/id_ed25519'to see if it works.