I want to add Webots to my Dockerfile, but I'm running into an issue. My current manual installation steps (from here) are:
$ # launch my Docker container without Webots
$ wget -qO- https://cyberbotics.com/Cyberbotics.asc | sudo apt-key add -
$ sudo apt update
$ sudo apt install -y software-properties-common
$ sudo apt-add-repository 'deb https://cyberbotics.com/debian/ binary-amd64/'
$ sudo apt update
$ sudo apt-get install webots
$ # now I have a Docker container with Webots
I want to include this process in the build of the Docker container. I can't just use the same steps in Dockerfile
though, because while webots is installing, it prompts for some stdin responses asking for the keyboard's country of origin. Since Docker doesn't listen to stdin while building, I have no way to answer these prompts. I tried piping echo
output like so, but it doesn't work:
# Install Webots (a robot simulator)
RUN wget -qO- https://cyberbotics.com/Cyberbotics.asc | sudo apt-key add -
RUN apt-get update && sudo apt-get install -y \
software-properties-common \
libxtst6
RUN sudo apt-add-repository 'deb https://cyberbotics.com/debian/ binary-amd64/'
RUN apt-get update && echo 31 1 | sudo apt-get install -y \
webots # the echo fills the "keyboard country of origin" prompts
How can I get Webots included in the Docker container? I don't want to just use someone else's container (e.g. cyberbotics/webots-docker), since I need to add other things to the container, like ROS2.