增加远程开发 快速入门

This commit is contained in:
Your Name
2024-05-27 10:29:01 +00:00
parent a2ba78c80c
commit 5fc8eefd6b
3 changed files with 71 additions and 11 deletions
+36
View File
@@ -37,4 +37,40 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.bashrc
rustup
```
## Docker[下载页面](https://docs.docker.com/engine/install/)
Linux - Ubuntu24.04
移除旧的
```bash
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
```
安装新的
```bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```
(可选) docker 用户组修改, 免root运行
```bash
sudo groupadd docker
sudo usermod -aG docker $USER
## 需要重启shell.
## 注意!! 每次登录shell都需要执行以下语句, 才能实现免root运行命令!!
newgrp docker
# 验证无需root运行docker
docker run hello-world
```