linux docker常用命令记录

一、防火墙

1. 开启防火墙

cpp 复制代码
systemctl start firewalld 

2.查看防火墙状态

cpp 复制代码
systemctl status firewalld

二、docker

1.启动docker

cpp 复制代码
systemctl start docker

2.关闭docker

cpp 复制代码
systemctl stop docker

3.重启docker

cpp 复制代码
systemctl restart docker

4.查看docker 运行状态

cpp 复制代码
systemctl status docker

三、docker镜像

1.拉取镜像

cpp 复制代码
docker pull 镜像名

2.查看镜像列表

cpp 复制代码
docker images

3.删除镜像

cpp 复制代码
docker rmi -f 镜像名/镜像ID

四、docker容器

1.查看所有容器列表

cpp 复制代码
docker ps -a

2.停止容器

cpp 复制代码
docker stop 容器ID/容器名

3.重启容器

cpp 复制代码
docker restart 容器ID/容器名

4.启动容器

cpp 复制代码
docker start 容器ID/容器名

5.运行容器

cpp 复制代码
docker run -it -d --name 取名 镜像名:Tag /bin/bash

6.删除容器

cpp 复制代码
# 停止运行的 redis 容器 
docker stop 容器名/容器ID
 
#删除一个容器
docker rm -f 容器名/容器ID

7. 进入容器

cpp 复制代码
docker exec -it 容器名/容器ID /bin/bash

8.退出容器

cpp 复制代码
exit
相关推荐
沧浪之水!8 分钟前
【Linux网络】:套接字之UDP
linux·网络·udp
BranH10 分钟前
Linux系统中命令设定临时IP
linux·运维·服务器
极小狐21 分钟前
极狐GitLab 项目功能和权限解读
运维·git·安全·gitlab·极狐gitlab
宁酱醇22 分钟前
GitLab_密钥生成(SSH-key)
运维·ssh·gitlab
秋风起,再归来~27 分钟前
【Linux庖丁解牛】—进程优先级!
linux·运维·服务器
cosX+sinY1 小时前
ubuntu 20.04 编译运行lio-sam,并保存为pcd
linux·ubuntu·机器人
诡异森林。1 小时前
Docker--Docker网络原理
网络·docker·容器
Lalolander1 小时前
设备制造行业如何避免项目管理混乱?
运维·制造·工程项目管理·四算一控·epc·环保设备工程·设备制造
ALex_zry1 小时前
Docker Macvlan网络配置实战:解决“network already exists“错误
网络·docker·php
IT小辉同学1 小时前
Docker如何更换镜像源提高拉取速度
spring cloud·docker·eureka