Closed cardboardcode closed 8 months ago
In terms of a long-term solution, it seems to be installing and running dos2unix
command within the Dockerfile
before running it as a container.
This can be done so by modifying line no. 46 in /humble/Dockerfile like so:
RUN apt-get update && \
tigervnc-standalone-server tigervnc-common \
supervisor wget curl gosu git sudo python3-pip tini \
build-essential vim sudo lsb-release locales \
bash-completion tzdata terminator \
dos2unix && \
Also modify line no. 120 in /humble/Dockerfile like so:
COPY ./entrypoint.sh /
RUN dos2unix /entrypoint.sh
ENTRYPOINT [ "/bin/bash", "-c", "/entrypoint.sh" ]
Doing so makes sure that entrypoint.sh
is using LF when loaded into the docker image.
Will try and run the same modification for a Linux host and see if it still works. If it still works, will update here and attempt to make a pull request to introduce the change for all.
Verified that the modified Dockerfile
above still works from a Linux host. The new Dockerfile
for ROS 2 Humble now looks like below:
@Tiryoh Would it be okay if I introduced dos2unix
as a dependency within Dockerfile
for ROS 2 Humble in a pull request?
Hi @cardboardcode, Thanks for the detailed report! Your suggestion sounds reasonable to me. Could you create a pull request?
Issue Description :bug:
Kept encountering the following error output upon running the docker container for ROS 2 Humble using the command below in Windows 10:
Command
Error :warning:
Environment :books:
10.0.19045 N/A Build 19045
25.0.3
Steps To Reproduce :hammer:
Please follow the instructions below to recreate the issue highlighted:
Download the repository
Build the docker image:
Build and run the docker container from docker image:
Expected Behaviour :green_circle:
The command prompt terminal should output a similar output as below:
Actual Behaviour :red_circle:
Docker container fails to build and run, giving the aforementioned error:
Rough Workaround :adhesive_bandage:
Make sure that the
humble/entrypoint.sh
is indented with LF, instead of CRLF. See this article below for more details as to why there is a difference between CRLF and LF, pertaining to different operating systems:https://dhwaneetbhatt.com/blog/why-crlf-vs-lf/
Open the file
humble/entrypoint.sh
in your preferred text editor. Search for a setting to convert line ending character from CRLF to LF.Eg. I used Visual Studio 2019 and it is found on the bottom right as shown below:
entrypoint.sh
:Remarks :speech_balloon:
Going to try and figure out a long term solution since it is slightly annoying to do the Rough Workaround every time. Will update here accordingly once I have done so.