The installation of docker container and the use of basic command visual management tool portainer (on)

docker download on center OS 7

yum安装
yum -y install docker
查看版本
docker -v 
启动服务
service docker start
修改配置信息
 vi /usr/lib/systemd/system/docker.service
 修改内容如下
 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock \

insert image description here

重新加载docker配置
systemctl daemon-reload // 1,加载docker守护线程
systemctl restart docker // 2,重启docker
查看docker里面镜像使用情况
docker images
docker进程
docker ps
docker下载mysql指定版本
docker pull mysql:5.7.23
只退出容器,不停止容器
Ctrl+p+q
启动容器
docker start 容器ID或容器名称
删除容器
docker rm 容器ID或容器名称
进入正在运行的容器
docker attach
宿主机路径从容器内拷贝文件到宿主机.
docker cp 容器ID:容器内的文件路径 

启动docker容器中的mysql(修改端口号不要跟本地端口号发生冲突,服务器上开放3307端口)
docker run -d -p 3307:3306 --name caosheng -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7.23

insert image description here

Start successfully as shown above, enter the docker image operation

docker exec -it  a07b33a1ceb7 /bin/bash

docker中添加vim 命令
apt-get update

apt-get install vim
添加ll命令
vim ~/.bashrc
在最后一行加
alias ll='ls $LS_OPTIONS -l'
资源生效
source ~/.bashrc
安装ping指令为            
apt-get install iputils-ping;
安装ifconfig指令为      
apt-get install net-tools,

Complete the docker configuration and the installation and use of msyql and the addition of basic commands to the management tool portainer installation, see
https://blog.csdn.net/m0_49412847/article/details/121511590?spm=1001.2014.3001.5501

Guess you like

Origin blog.csdn.net/m0_49412847/article/details/121510801