Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7072

`source` command fails in Dockerfile though there are no errors

$
0
0

I build an image from a Dockerfile that sources a file and builds ws workspace with docker build --build-arg SSH_PRIVATE_KEY="$(cat ~/.ssh/id_ed25519)" -t my_image .. But, the build fails on line #4 because cmake complains about some missing packages.If I comment out lines #3 and #4, build the image and then manually do lines #3 and #4 through connecting to the container via docker exec -it ... the build of ws workspace succeeds. It only tells me that source (line #3) fails though there are no errors during docker image build.

What am I missing here? Below is what I have tried.

Dockerfile

1.  FROM ubuntu:20.04    ...2.  WORKDIR /home/ws    ...  3.  RUN source /opt/ros/noetic/setup.bash4.  RUN colcon build

What I tried:

  1. Adding SHELL ["/bin/bash", "-c"] before line #3
  2. Changing line #3 to RUN ["/bin/bash", "-c", "source /opt/ros/noetic/setup.bash"]

Viewing all articles
Browse latest Browse all 7072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>