ubuntu C++开发环境

  1. ## our local base image
  2. FROM ubuntu:20.04
  3. ## something infomations
  4. MAINTAINER geodoer<geodoer@163.com>
  5. LABEL description = "Container for use with Visual Studio"
  6. ## use aliyun
  7. RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
  8. ## install build dependencies
  9. RUN apt-get update
  10. RUN apt-get install -y rsync
  11. RUN apt-get install -y zip
  12. RUN apt-get install -y g++ make cmake gdb
  13. ## install and configure SSH for communication with Visual Studio
  14. RUN apt-get install -y openssh-server
  15. # create user for SSH
  16. RUN useradd -m -d /home/geodoer -s /bin/bash -G sudo geodoer
  17. # set user password
  18. RUN echo "geodoer:geodoer123" | chpasswd
  19. # configure ssh
  20. RUN mkdir -p /var/run/sshd
  21. RUN echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config && ssh-keygen -A
  22. # expose port 22
  23. EXPOSE 22
  24. # start ssh and enter bash
  25. ENTRYPOINT [ "sh", "-c", "service ssh start; bash"]