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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
T
Threatpost
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs
S
Securelist
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
S
Secure Thoughts
MyScale Blog
MyScale Blog
O
OpenAI News
P
Palo Alto Networks Blog
美团技术团队
C
Cyber Attacks, Cyber Crime and Cyber Security
TaoSecurity Blog
TaoSecurity Blog
量子位
L
Lohrmann on Cybersecurity
G
GRAHAM CLULEY
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
Know Your Adversary
Know Your Adversary
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Simon Willison's Weblog
Simon Willison's Weblog
宝玉的分享
宝玉的分享
PCI Perspectives
PCI Perspectives
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
I
InfoQ
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
S
Security @ Cisco Blogs
S
Schneier on Security
B
Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Cloudflare Blog
AWS News Blog
AWS News Blog
IT之家
IT之家
V
Vulnerabilities – Threatpost
The Hacker News
The Hacker News
H
Heimdal Security Blog
I
Intezer
A
Arctic Wolf
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
W
WeLiveSecurity

博客园 - 倾听-静轩水月

Mysql优化笔记 Arthas使用 vue2.0和vue3.0同时使用 零基础尝试mybatis-plus读写分离 零基础尝试搭建docker和nacos环境 零基础尝试mysql主从复制 mybatis-plus 批量插入示例 找回windows应用商店 linux 开放端口 小白零基础在 Centos 7 中安装 mysql http转向https 内存不够导致编译报错:Information:java: java.lang.OutOfMemoryError: GC overhead limit exceeded CentOS7使用命令行安装Oracle11GR2 使用Xshell连接VMware上的Linux虚拟机 mysql免安装版初次使用 微信小程序支付证书及SSL证书使用 SqlServer无备份下误删数据恢复 javaweb学习--javabean javaweb学习--jsp
docker常用命令
倾听-静轩水月 · 2021-04-06 · via 博客园 - 倾听-静轩水月

--Dockerfile 内容
# 基于哪个镜像
 1 FROM java:8 

# 将本地文件夹挂载到当前容器
 1 VOLUME /tmp 

# 复制文件到容器

1 ADD liuxiaofeng-module-system-2.2.0.jar(文件名) liuxiaofeng-module-system.jar(重命名)
2 RUN bash -c 'touch /liuxiaofeng-module-system.jar'

View Code

# 声明需要暴露的端口

View Code

# 配置容器启动后执行的命令

1 ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/liuxiaofeng-module-system.jar"]

View Code

--构建和运行容器
1、下载java8镜像 注:最开始的时候才需要

1 docker run java /bin/echo 'hello world'

View Code

2、构建镜像(在Dockerfile路径下)

1 docker build -t liuxiaofeng-module-system(镜像名称) .(本地路径)

View Code

3、运行docker镜像

1 docker run --name liuxiaofeng-module-system(命名) -d -p 8687:8687(指定端口) liuxiaofeng-module-system(指定镜像)

View Code

--删除容器和镜像
1、列出所有容器

View Code

2、删除容器

1 docker rm 容器id 注:若提示在运行状态,则 docker kill 容器id

View Code

3、列出所有镜像

View Code

4、删除镜像

View Code

--启动已存在容器

View Code