9/26/2023 0 Comments Zsh command not found dockerI was able to add the path to my path environment variable, which solved the “command cannot be found” issue, but instead I got the following fmriprep-docker /deep/heller/work/Healthyu /deep/heller/work/Healthyu/sub-5002 participant -participant-label 5002 -fs-license-file /usr/local/freesurfer/6.0.0/license.txt -ignore slicetiming Or RUN /bin/bash -c 'echo "source /MY_PROJECT/devel/setup.bash" > ~/.Hi there - I was having similar issues as and we are actually operating from the same server at the same university. bashrc (the "run commands" at the start of the bash) so that this is loaded at every start of the bash: RUN PS2: You can also add the source command to the. The error was always like: executor failed running. Nor with RUN ["/bin/bash", "-c", "source /opt/ros/melodic/setup.bash Nor with RUN ["/bin/bash", "-c", "source /opt/ros/melodic/setup.bash \ Nor with RUN ["/bin/bash", "-c", "source /opt/ros/melodic/setup.bash & At least I could not (!) get it to run with: RUN ["/bin/bash", "-c", "source /opt/ros/melodic/setup.bash & \ Mind that when using RUN with this frame, this works only in a one-liner. Or same with RUN /bin/bash -c 'source /opt/ros/melodic/setup.bash \ Or in many lines with RUN /bin/bash -c 'source /opt/ros/melodic/setup.bash &\Įcho "source /MY_PROJECT/devel/setup.bash" > ~/.bashrc' PS: You can also put many bash commands in a row: RUN You might also put the commands you want to execute in a single bash script and run that bash script in the Dockerfile (though I would rather put the bash commands in the Dockerfile as well, just my opinion): #!/bin/bash Else, it will throw the error: /bin/bash: opt/ros/melodic/setup.bash: No such file or directory Side-note: do not forget the first "/" before "opt/./.". It needs cd /MY_PROJECT even if you have set WORKDIR. For example, mind that setting WORKDIR /MY_PROJECT before the bash commands in the Dockerfile does not affect the bash commands since the starting folder would have to be set in the ".bashrc" again. Or with the " " (which I would rather not use): RUN Įvery new RUN of a bash is isolated, "starting at 0". In the Dockerfile case, use the recommended RUN /bin/bash -c 'source /opt/ros/melodic/setup.bash' In other words, this problem can occur in any setting where the "sh" shell is used instead of the "bash", causing "/bin/sh: 1: MY_COMMAND: not found". Your shell is /bin/sh, but source expects /bin/bash, perhaps because it Taken from /bin/sh: 1: gvm: not found, which would say more or less: Since the "source" command works in the container MY_CONTAINER_NAME, how can I get the bash shell working in the underlying image MY_IMAGE_NAME during the docker build of the Dockerfile, instead of using the sh shell? _setup_util.py env.sh include local_setup.bash local_setup.zsh setup.sh shareīin etc lib local_setup.sh setup.bash lsīin etc lib local_setup.sh setup.bash setup.zshĪnd I could have just checked it directly anyway, works: source /opt/ros/melodic/setup.bash Now in the container, in the bash (which was loaded using /bin/bash above): cd cd cd ls By default, only the "build context", in this case where you start the Dockerfile, is not empty. How can it be not available in the image, then? docker run -dit -name MY_CONTAINER_NAME -v /opt/ros/melodic/ MY_IMAGE:latestĭocker exec -it MY_CONTAINER_NAME /bin/bashįyi: -v /opt/ros/melodic/ mounts the volume -v, else /opt/ros/melodic/ would be empty. Thus, the "source" command is available in the bash of the container. To test this, I created an image of a step before the error step, and checked the command inside the container: and it worked. executor failed running : exit code: 127 The following error appeared: => ERROR RUN source /opt/ros/melodic/setup.bash , using a Dockerfile for a ROS project, at line RUN source /opt/ros/melodic/setup.bash
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |