Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zzlion
committed
Apr 25, 2023
1 parent
20d184f
commit 185ac3c
Showing
2 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
title: wsl端口windows访问 | ||
description: "" | ||
date: 2023-04-24 | ||
date: 2023-04-23 | ||
tags: | ||
- 202304 | ||
- wsl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
title: docker命令行 | ||
description: "" | ||
date: 2023-04-25 | ||
tags: | ||
- 202304 | ||
- docker | ||
categories: | ||
- 202304 | ||
menu: main | ||
--- | ||
|
||
## 重要 | ||
|
||
1. image是静态文件,container是运行在内存中的进程 | ||
1. 容器内程序必须前台运行 | ||
|
||
## docker build | ||
|
||
1. `docker build .` 构建image | ||
1. `docker build -t <image-name>/<repo-name>:<tagname> .` | ||
|
||
## docker run | ||
|
||
1. `docker run --publish 80:80/tcp <image>` 前台运行 | ||
1. `docker run --publish 80:80/tcp --detach <image>` | ||
1. `docker run --publish 80:80/tcp --d <image>` | ||
|
||
- -publish/-p | ||
1. 开启host与容器内端口映射 | ||
- -e | ||
1. -e FLASK_ENV=production | ||
|
||
## docker logs | ||
|
||
1. `docker logs --folow <container>` | ||
1. `docker logs --f <container>` | ||
|
||
## docker ps | ||
|
||
1. `docker ps`查看运行的容器 | ||
|
||
## docker stop | ||
|
||
1. `docker stop <container>` graceful 结束运行的容器 | ||
|
||
## docker kill | ||
|
||
1. `docker kill <container>` crude 结束运行的容器 | ||
|
||
## docker push | ||
|
||
1. `docker push <image name>/<repo-name>:<tagname>` | ||
|
||
## docker container | ||
|
||
- ls | ||
1. `docker container ls -a` | ||
- rm | ||
1. `docker container rm <hashid>` | ||
|
||
## docker image | ||
|
||
- ls | ||
1. `docker image ls` | ||
- rm | ||
1. `docker image rm <image-name>` ref的container都移除后才可以删除 |
185ac3c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
wawlixiong-github-io – ./
wawlixiong-github-io.vercel.app
wawlixiong-github-io-git-master-wawlixiong.vercel.app
www.wawlixiong.fun
wawlixiong-github-io-wawlixiong.vercel.app
wawlixiong.fun