I was trying to build ROS with ardupilot.
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
#RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt install curl
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
RUN apt update
RUN apt install ros-melodic-desktop-full -y
RUN apt search ros-melodic
RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
RUN source ~/.bashrc
When I built that;
CACHED [54/71] RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc 0.0s
ERROR [55/71] RUN source ~/.bashrc 0.4s
# ------
[55/71] RUN source ~/.bashrc:
##0 0.332 /bin/sh: 1: source: not found
# ------
Dockerfile:87
# --------------------
85 |
86 | RUN echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
87 | >>> RUN source ~/.bashrc
88 | #RUN source /opt/ros/melodic/setup.bash
89 |
# --------------------
ERROR: failed to solve: process "/bin/sh -c source ~/.bashrc" did not complete successfully: exit code: 127
this error is occuring.
What should I do to solve that error?