默认环境:debian11、go1.20。创建文件Dockerfile,写入一下内容FROM golang:1.20.4 MAINTAINER cdx cdxccx@outlook.com ENV password="root" RUN echo 'root:$password' |chpasswd RUN apt update && \ apt-get install -y openssh-server && \ apt clean && \ rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp* && \ echo "PermitRootLogin yes" >> /etc/ssh/sshd_config && \ echo "export PATH=/usr/local/go/bin:$PATH" >> /root/.bash