This is just a piece of a Dockefile that's confusing me. It has some extra debugging lines in it by the way. In the first line I create /home/ubuntu/.bashrc. However then at the last line, it acts as if it cannot run it.
RUN echo 'source /opt/ros/kinetic/setup.bash' >> /home/ubuntu/.bashrc
RUN echo 'source /home/ubuntu/catkin_ws/devel/setup.bash' >> /home/ubuntu/.bashrc
RUN /bin/bash -c "echo 'export HOME=/home/ubuntu' >> /root/.bashrc && source /root/.bashrc"
RUN pwd
RUN cd ~ && pwd
RUN cat /home/ubuntu/.bashrc
RUN mkdir -p ~/catkin_ws/src
RUN source /home/ubuntu/.bashrc && \
cd ~/catkin_ws/src && \
/opt/ros/kinetic/bin/catkin_init_workspace && \
cd ~/catkin_ws && \
catkin_make
Here's the output:
Step 13/32 : RUN echo 'source /opt/ros/kinetic/setup.bash' >> /home/ubuntu/.bashrc
---> Using cache
---> a60c2d1482d8
Step 14/32 : RUN echo 'source /home/ubuntu/catkin_ws/devel/setup.bash' >> /home/ubuntu/.bashrc
---> Using cache
---> 3be964ee0c36
Step 15/32 : RUN /bin/bash -c "echo 'export HOME=/home/ubuntu' >> /root/.bashrc && source /root/.bashrc"
---> Using cache
---> 83cf2e5f4b1c
Step 16/32 : RUN pwd
---> Using cache
---> 40915ecc834d
Step 17/32 : RUN cd ~ && pwd
---> Using cache
---> 92f2cee78a48
Step 18/32 : RUN cat /home/ubuntu/.bashrc
---> Using cache
---> c8f467775b33
Step 19/32 : RUN mkdir -p ~/catkin_ws/src
---> Using cache
---> 53e5c403949f
Step 20/32 : RUN source /home/ubuntu/.bashrc && cd ~/catkin_ws/src && /opt/ros/kinetic/bin/catkin_init_workspace && cd ~/catkin_ws && catkin_make
---> Running in 708d485325e2
/bin/sh: 1: source: not found
The command '/bin/sh -c source /home/ubuntu/.bashrc && cd ~/catkin_ws/src && /opt/ros/kinetic/bin/catkin_init_workspace && cd ~/catkin_ws && catkin_make' returned a non-zero code: 127
Naturally, it's my bug but I cant see it nor the gap in my understanding.Thanks!