整理文档
This commit is contained in:
@ -10,7 +10,7 @@ docker ps
|
|||||||
|
|
||||||
### 启动、停止、重启容器
|
### 启动、停止、重启容器
|
||||||
|
|
||||||
```
|
```bash
|
||||||
docker start {容器名称或者Id}
|
docker start {容器名称或者Id}
|
||||||
|
|
||||||
docker stop {容器名称或者Id}
|
docker stop {容器名称或者Id}
|
||||||
@ -18,4 +18,16 @@ docker stop {容器名称或者Id}
|
|||||||
docker restart {容器名称或者Id}
|
docker restart {容器名称或者Id}
|
||||||
```
|
```
|
||||||
|
|
||||||
###
|
### 进入容器
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec -it [containerName] bash
|
||||||
|
```
|
||||||
|
|
||||||
|
### 镜像构建命令
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t [imagesName] -f Dockerfile .
|
||||||
|
```
|
||||||
|
|
||||||
|
ps:命令要在 Dockerfile 在的目录下执行
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.8 KiB |
BIN
docker/image.png
BIN
docker/image.png
Binary file not shown.
Before Width: | Height: | Size: 40 KiB |
14
docker/issue/issue.md
Normal file
14
docker/issue/issue.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<h1>Docker 相关的问题讨论</h1>
|
||||||
|
|
||||||
|
## 解决 Docker 容器不支持中文的问题,中文乱码问题
|
||||||
|
|
||||||
|
#### 编写 Dockerfile
|
||||||
|
|
||||||
|
```Dockerfile
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||||
|
WORKDIR /app #容器内的工作目录
|
||||||
|
EXPOSE 80 #容器监听的端口
|
||||||
|
ADD /Fonts/* /usr/share/fonts/ #中文字体
|
||||||
|
ENV LANG=C.UTF-8 #容器默认编码
|
||||||
|
ENTRYPOINT ["dotnet","RapidApp.Api.dll"]
|
||||||
|
```
|
@ -1,49 +0,0 @@
|
|||||||
<h1>解决docker中文乱码</h1>
|
|
||||||
|
|
||||||
## 构建镜像
|
|
||||||
|
|
||||||
1. 编写Dockerfile
|
|
||||||
```Dockerfile
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
|
||||||
WORKDIR /app #容器内的工作目录
|
|
||||||
EXPOSE 80 #容器监听的端口
|
|
||||||
ADD /Fonts/* /usr/share/fonts/ #中文字体
|
|
||||||
ENV LANG=C.UTF-8 #容器默认编码
|
|
||||||
ENTRYPOINT ["dotnet","RapidApp.Api.dll"]
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 构建命令
|
|
||||||
```cmd
|
|
||||||
docker build -t [imagesName] -f Dockerfile .
|
|
||||||
```
|
|
||||||
ps:命令要在Dockerfile在的目录下执行
|
|
||||||
|
|
||||||
## 添加容器
|
|
||||||

|
|
||||||
|
|
||||||
## 查看容器字体
|
|
||||||
1. 进入容器
|
|
||||||
```cmd
|
|
||||||
docker exec -it [containerName] bash
|
|
||||||
```
|
|
||||||

|
|
||||||
|
|
||||||
2. 查看字体
|
|
||||||
* fc-list :查看所有字体
|
|
||||||
* fc -list:lang-zh:查看中文字体
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
3. 命令不起作用
|
|
||||||
|
|
||||||
如果出现以下信息
|
|
||||||
```cmd
|
|
||||||
bash: fc-list: command not found
|
|
||||||
```
|
|
||||||
|
|
||||||
解决:
|
|
||||||
```cmd
|
|
||||||
apt-get update
|
|
||||||
apt-get upgrade
|
|
||||||
apt-get install fontconfig
|
|
||||||
```
|
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
22
linux/cli.md
Normal file
22
linux/cli.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
### 查看字体
|
||||||
|
|
||||||
|
```bash
|
||||||
|
- fc-list # 查看所有字体
|
||||||
|
- fc -list:lang-zh #查看中文字体
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
#### 如果出现以下信息
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash: fc-list: command not found
|
||||||
|
```
|
||||||
|
|
||||||
|
解决:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
apt-get update
|
||||||
|
apt-get upgrade
|
||||||
|
apt-get install fontconfig
|
||||||
|
```
|
Reference in New Issue
Block a user