下载Docker
https://www.docker.com/products/docker-desktop
下载centos
docker pull centos:7
启动centos
docker run -d -it -p 20:20 -p 21:21 -p 80:80 -p 443:443 -p 888:888 -p 8888:8888 -p 6789:6789 -p 6788:6788 -p 6787:6787 -p 6786:6786 --privileged -v /Users/wangj/documents -d centos /usr/sbin/init 常用端口修改映射 docker run -d -it -p 20:20 -p 21:21 -p 80:81 -p 443:444 -p 888:889 -p 8888:8888 -p 6789:6789 -p 6788:6788 -p 6787:6787 -p 6786:6786 -p 6379:6380 -p 3306:3307 --privileged -v /Users/wangj/documents -d centos-bt /usr/sbin/init
运行容器
docker exec -it 29c4b0601ead /bin/bash
安装宝塔BT
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
问题
Failed to get D-Bus connection: Operation not permitted Error: DBUS_ERROR: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory docker commit 29c4b0601ead centos docker stop $(docker ps -a -q)
第二次进来容器,之前安装过的东西都得重新安装一遍,那怎么办呢
docker ps docker commit 29c4b0601ead centos #29c4b0601ead是ConTAINER ID,centos是IMAGE,容器名 这样之后再回到容器的那个窗口运行 exit,下次再进来就不会丢失在容器内的保存了



