惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
Simon Willison's Weblog
Simon Willison's Weblog
H
Help Net Security
F
Fortinet All Blogs
H
Heimdal Security Blog
S
Schneier on Security
L
LangChain Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
NISL@THU
NISL@THU
P
Palo Alto Networks Blog
J
Java Code Geeks
博客园 - 【当耐特】
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
I
InfoQ
Recorded Future
Recorded Future
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
CERT Recently Published Vulnerability Notes
T
Tenable Blog
腾讯CDC
C
Check Point Blog
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
罗磊的独立博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog
小众软件
小众软件
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
V2EX - 技术
V2EX - 技术
T
Threatpost
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
T
Tailwind CSS Blog
S
Securelist
The Cloudflare Blog
博客园 - 叶小钗
L
LINUX DO - 最新话题
T
Troy Hunt's Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
爱范儿
爱范儿

博客园 - 007少侠

使用Recaf编辑汇编代码直接修改java的编译代码class Centos Linux 更换源,原官方源已经不再提供服务 如何在Docker容器中的Linux系统(Ubuntu + Centos Linux)里面使用systemctl Centos Linux 7 搭建邮件服务器(postfix + dovecot) Ubuntu Linux 搭建邮件服务器(postfix + dovecot) 【WSL2】在Windows通过自定义域名访问wsl2中的服务 Python pip pip3 源设置成国内源,阿里云源,清华大学源 利用云服务器实现内网穿透(frp),开启个人电脑(windows)可远程桌面访问 Rust交叉编译Mac编译Linux/Windows平台 Linux下安装dart sdk并配置环境变量 Linux下安装JDK-openj9并配置环境变量 centos7 安装 bbr加速 linux环境常用命令和java/jvm常用命令 mybatis plus + druid多数据源(使用dynamic实现) docker将容器打包成镜像并传输至其他服务器部署(可用于容器重新run) .gitignore == git添加忽略不生效解决方案 jenkins自动构建项目源码git pull时出现冲突的终极解决方案(git远程覆盖本地分支) mysql查询,根据时间查询:几天前、几天内的数据 spring boot 使用aop实现拦截器
使用docker安装centos7并挂载主机目录
007少侠 · 2021-09-06 · via 博客园 - 007少侠

1. docker拉取官方centos镜像

docker pull centos:centos7

2. 等待下载完成后,我们就可以在本地镜像列表里查到

mac@MacdeMacBook-Pro ~ % docker images                                       
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
centos       centos7   8652b9f0cb4c   9 months ago   204MB

3.运行容器(直接挂载主机的/Users/mac/bingo/test_dir目录到容器的/root/test_dir目录)

docker run --privileged --name=centos7_01 -itd -v /Users/mac/bingo/test_dir:/root/test_dir centos:centos7

命令解释:

--privileged   #超级权限
--name     #指定容器名称

4.进入容器

docker exec -it centos7_01 /bin/bash

5.退出容器

附=>常用命令:

查看已经安装的镜像:
docker images

查看正在运行的容器:
docker ps

查看所有容器:
docker ps -a

停止运行容器:
docker stop 容器名称/ID

启动容器:
docker start 容器名称/ID

删除容器(非镜像):
docker rm 容器名称/ID