整理文档

This commit is contained in:
徐永兴 2023-10-17 08:31:02 +08:00
parent ad897f90ea
commit c870d78b6a
9 changed files with 50 additions and 51 deletions

View File

@ -10,7 +10,7 @@ docker ps
### 启动、停止、重启容器
```
```bash
docker start {容器名称或者Id}
docker stop {容器名称或者Id}
@ -18,4 +18,16 @@ docker stop {容器名称或者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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

14
docker/issue/issue.md Normal file
View 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"]
```

View File

@ -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在的目录下执行
## 添加容器
![Alt text](image.png)
## 查看容器字体
1. 进入容器
```cmd
docker exec -it [containerName] bash
```
![Alt text](image-1.png)
2. 查看字体
* fc-list :查看所有字体
* fc -list:lang-zh:查看中文字体
![Alt text](image-2.png)
3. 命令不起作用
如果出现以下信息
```cmd
bash: fc-list: command not found
```
解决:
```cmd
apt-get update
apt-get upgrade
apt-get install fontconfig
```

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

22
linux/cli.md Normal file
View File

@ -0,0 +1,22 @@
### 查看字体
```bash
- fc-list # 查看所有字体
- fc -list:lang-zh #查看中文字体
```
![查看字体](./assets/view-font.png)
#### 如果出现以下信息
```bash
bash: fc-list: command not found
```
解决:
```bash
apt-get update
apt-get upgrade
apt-get install fontconfig
```