ros2-galactic.Dockerfile 1020 B

123456789101112131415161718192021222324252627
  1. FROM ros:galactic-ros-base-focal
  2. ARG ROS_DISTRO=galactic
  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. # [Optional] Add sudo support. Omit if you don't need to install software after connecting.
  11. RUN sed -i 's/http:\/\/archive.ubuntu.com\//http:\/\/mirrors.aliyun.com\//g' /etc/apt/sources.list \
  12. && apt-get update && apt-get install -y --no-install-recommends sudo \
  13. libc-bin \
  14. binutils
  15. # ********************************************************
  16. # * Anything else you want to do like clean up goes here *
  17. # ********************************************************
  18. RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/jasper/.bashrc \
  19. && echo "export TERM=xterm-256color" >> /home/jasper/.bashrc
  20. # [Optional] Set the default user. Omit if you want to keep the default as root.
  21. USER $user
  22. CMD ["/bin/bash"]