Docker/yapi:修订间差异
来自康健生活
< Docker
| (未显示同一用户的8个中间版本) | |||
| 第7行: | 第7行: | ||
{{shc|<syntaxhighlight lang="bash"> | {{shc|<syntaxhighlight lang="bash"> | ||
# docker run -it <image_name> /bin/bash | # docker run -it <image_name> /bin/bash | ||
sudo docker run -it | sudo docker run -p 9090:9090 -it yapi-tmp:v0.0.1 /bin/bash</syntaxhighlight>|$|/home/kangkk}} | ||
同步 pacman 软件数据库 | 同步 pacman 软件数据库 | ||
| 第24行: | 第24行: | ||
### | ### | ||
fnm install 10 | fnm install 10 | ||
### | |||
ln -s /root/.local/share/fnm/node-versions/v10.24.1/installation/bin/node /usr/bin/node | |||
### | |||
npm install -g node-gyp | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
安装编译环境 | |||
{{shc|<syntaxhighlight lang="bash"> | |||
pacman -S gcc | |||
pacman -S base-devel | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
安装 pyenv | |||
{{shc|<syntaxhighlight lang="bash"> | |||
pacman -S pyenv | |||
### | |||
pyenv install 3.10.4 | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
容器打包镜像 | |||
{{shc|<syntaxhighlight lang="bash"> | |||
sudo docker commit 8f0ff3b8b1e0 yapi-tmp:v0.01 | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
再次进入 yapi-tmp:v0.01 镜像,执行 yapi 安装后继续打包 | |||
{{shc|<syntaxhighlight lang="bash"> | |||
sudo docker commit 58a3fb364630 yapi-server:v0.0.1 | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
运行 | |||
{{shc|<syntaxhighlight lang="bash"> | |||
sudo docker run -d \ | |||
--name yapi \ | |||
--restart always \ | |||
-p 3017:3017 \ | |||
yapi-server:v0.0.2 \ | |||
node /root/yapi/vendors/server/app.js | |||
</syntaxhighlight>|$|/home/kangkk}} | </syntaxhighlight>|$|/home/kangkk}} | ||
2025年3月11日 (二) 09:18的最新版本
标题文本
下载 OS
/home/kangkk
sudo docker pull archlinux
创建并进入容器
/home/kangkk
# docker run -it <image_name> /bin/bash
sudo docker run -p 9090:9090 -it yapi-tmp:v0.0.1 /bin/bash
同步 pacman 软件数据库
/home/kangkk
pacman -Syyu
安装 unzip
/home/kangkk
pacman -S unzip
安装 nodejs
/home/kangkk
curl -o- https://fnm.vercel.app/install | bash
###
source /root/.bashrc
###
fnm install 10
###
ln -s /root/.local/share/fnm/node-versions/v10.24.1/installation/bin/node /usr/bin/node
###
npm install -g node-gyp
安装编译环境
/home/kangkk
pacman -S gcc
pacman -S base-devel
安装 pyenv
/home/kangkk
pacman -S pyenv
###
pyenv install 3.10.4
容器打包镜像
/home/kangkk
sudo docker commit 8f0ff3b8b1e0 yapi-tmp:v0.01
再次进入 yapi-tmp:v0.01 镜像,执行 yapi 安装后继续打包
/home/kangkk
sudo docker commit 58a3fb364630 yapi-server:v0.0.1
运行
/home/kangkk
sudo docker run -d \
--name yapi \
--restart always \
-p 3017:3017 \
yapi-server:v0.0.2 \
node /root/yapi/vendors/server/app.js
No categories