查找镜像
执行pull
docker pull golang:1.16.15
开启容器
docker run -itd --name go16 -p 8090:8099 -v C:/wwwroot:/go golang:1.16.15
将本地目录C:/wwwroo挂在到容器的go
必须要-it
,否则执行不起来
进入容器
docker exec -it go16 bash
更新apt-get
- 部署镜像
vim /etc/apt/sources.list
注释原来的(debian容器,其他容器镜像自行百度)
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
apt-get update
安装vim
apt-get install vim
网友评论