ros-melodic.Dockerfile 1.0 KB

12345678910111213141516171819202122232425262728
  1. FROM ros:melodic-robot
  2. ARG ROS_DISTRO=melodic
  3. # Setup user account
  4. ARG uid=1000
  5. ARG gid=1000
  6. ARG user=jasper
  7. RUN groupadd -r -f -g ${gid} ${user} && useradd -o -r -l -u ${uid} -g ${gid} -ms /bin/bash ${user}
  8. RUN usermod -aG sudo ${user}
  9. RUN echo "${user}:888888" | chpasswd
  10. ENV DEBIAN_FRONTEND=noninteractive
  11. # [Optional] Add sudo support. Omit if you don't need to install software after connecting.
  12. RUN sed -i 's/http:\/\/archive.ubuntu.com\//http:\/\/mirrors.aliyun.com\//g' /etc/apt/sources.list \
  13. && apt-get update && apt-get install -y --no-install-recommends sudo \
  14. libc-bin \
  15. binutils
  16. # ********************************************************
  17. # * Anything else you want to do like clean up goes here *
  18. # ********************************************************
  19. RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/jasper/.bashrc \
  20. && echo 'cd ~/Work/Robot' >> /home/jasper/.bashrc
  21. # [Optional] Set the default user. Omit if you want to keep the default as root.
  22. USER $user
  23. CMD ["/bin/bash"]