Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mkcup
demo
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
demo
/
docker_Note
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
70 lines (37 loc) · 1.82 KB
master
Breadcrumbs
demo
/
docker_Note
Copy path
Top
File metadata and controls
Code
Blame
70 lines (37 loc) · 1.82 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
三個空間:
本機開發環境空間
linux VM空間
container空間
Docker Registry:存放docker image地方,例如官方docker hub目前最大的registry, 公司私有registry
image名稱格式
[user name]使用者名稱/[repo name]倉庫名稱:[tag name]
EX:gmkcup/gmkcupTestimage:ubuntu14
列出本機image
docker images
將image 存入(備份)本機環境
docker save -o xxx.tar 前墜詞(帳號名)/image名稱
將本機tar檔還原docker image
docker load --input webdemou12.tar
刪除image(如果有容器還在使用這個映像檔,則無法刪除, 需要rm容器後才可rmi image)
docker rmi
image加入tag
同一性質的image若要區分例如版本的概念, 可以加入tag進行區分, ex:現行Ubuntu12+Spring2,
後續若要建ubuntu14+Spring 則可利用tag 方式進行同一image不同tag的存放方式
docker tag joshhu/webdemo:latest joshhu/webdemo:u14
docker container run(create)
docker container kill
刪除執行中的Container, 但仍存在於container
docker container stop
docker container start
查看container
docker container ps :列出正在執行的container,
docker container ps -a: 列出已經執行完,死掉但還沒消失的Container, 未加-a則僅可看到正在執行的container
docker containser -t:Container的螢幕會接到原來的螢幕上使其具備輸出功能
docker containser -i:鍵盤輸入會被Container接手使其具備輸入功能
上述用法可直接合併使用docker container -it: 這個Container就具備了標準的輸入(即你目前使用的鍵盤)和輸出(標準的Linux輸出,即目前操作的終端視窗)。
使用後可進入containser內部操作介面
docker container -d :可使用-d 參數將container丟背景常駐服務
組合用法
docker run -d -itd -p 8080:80 --name mkcuphttp httpd
執行容器
docker container run image名稱
You can’t perform that action at this time.