The CLI is built with Node.js and installable via npm. Install the community-maintained heroku-cli 7.60.1-1. Use the standalone installation for an autoupdating version of the CLI. Install with Ubuntu / Debian apt-get $ curl | sh xz is much smaller, but gz is more compatible. These tarballs are available in gz or xz compression. You can also download one of these tarballs and extract it yourself. The script requires sudo and isn’t Windows compatible. To set up the CLI in /usr/local/lib/heroku and /usr/local/bin/heroku, run this script. It contains its own Node.js binary and autoupdates. The standalone install is a simple tarball with a binary. Or RUN /bin/bash -c 'echo "source /MY_PROJECT/devel/setup.bash" > ~/.Download the appropriate installer for your Windows installation:ģ2-bit installer Standalone Installation with a Tarball 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. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |