9/8/2023 0 Comments Zsh command not found docker![]() ![]() I removed everything and tried the curl command (pointed at /usr/bin instead of /usr/local/bin) again, followed by the chmod command. usr/bin/docker-compose: line 1: Not: command not found Ln -s /usr/local/bin/docker-compose /usr/bin/docker-composeĪnd I try to test the installation again. Notice that it seems to want /usr/bin instead of /usr/local/bin, so (as suggested on the docs install page) I run I run the curl command (which I literally copied/pasted from the docs install page)Ĭurl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-composeīash: /usr/bin/docker-compose: Permission denied I installed Docker Compose using the instrux found in the Linux section of the docs install page. Or RUN /bin/bash -c 'echo "source /MY_PROJECT/devel/setup.bash" > ~/.I’m running Armbian (Debian Buster arm64) on an Odroid HC2 (XU4). 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 Just get rid of the first line and change main:main to node:node. 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 |