Linux下丝滑使用docker

安装docker

安装由debian维护的docker.io,参考https://www.kali.org/docs/containers/installing-docker-on-kali/

sudo apt update
sudo apt install docker.io
sudo systemctl enable docker --now

为普通用户添加docker的权限

sudo usermod -aG docker $USER

更改docker镜像(参考了https://www.cnblogs.com/yuzhihui/p/17461781.html)

sudo vim /etc/docker/daemon.json 

添加内容如下

{
  "registry-mirrors": [
	  "https://dockerproxy.cn"		
  ]
}

然后重启docker容器

sudo systemctl restart docker

安装docker-compose

sudo curl -L "https://github.com/docker/compose/releases/download/v2.29.7/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo chmod +x /usr/local/bin/docker-compose

测试

docker run hello-world
posted @ 2024-10-19 11:56  MarmaladeCat  阅读(20)  评论(0编辑  收藏  举报