美文网首页
docker安装go

docker安装go

作者: 呦丶耍脾气 | 来源:发表于2023-06-06 18:14 被阅读0次

查找镜像

docker仓库

执行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

相关文章

网友评论

      本文标题:docker安装go

      本文链接:https://www.haomeiwen.com/subject/mepgedtx.html