228 字
1 分钟
关于 docker 的命令总结
更新 apt 源
(这里使用的是 ubuntu 22.04 的源)
sudo rm /etc/apt/sources.list.d/*
echo "# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse" > /etc/apt/sources.list
sudo apt update && sudo apt install vim wget unzip
开启 ssh 远程连接和 X11
启动 SSH 服务:
/etc/init.d/ssh start
查看端口命令:
sudo apt install net-tools
netstat -tuln | grep :22
docker 容器如何开启 ssh 远程连接和 X11_x11-forwarding : (disabled or not supported by s-CSDN博客
docker 指定 GPU 进行开启
--gpus='"device=3,4"'