标签:阿里 link pytho 下载地址 device 索引 file oba 五步
sudo yum update
yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce
docker -v
参考https://www.jianshu.com/p/a97d2efb23c5
docker run -d --name mongo-yapi mongo
docker pull registry.cn-hangzhou.aliyuncs.com/anoy/yapi
docker run -it --rm --link mongo-yapi:mongo --entrypoint npm --workdir /api/vendors registry.cn-hangzhou.aliyuncs.com/anoy/yapi run install-server
他会给你一个初始的账户账号密码
自定义配置文件挂载到目录 /api/config.json
,官方自定义配置文件 -> 传送门
docker run -d --name yapi --link mongo-yapi:mongo --workdir /api/vendors -p 3000:3000 \
registry.cn-hangzhou.aliyuncs.com/anoy/yapi server/app.js
#-p 对外开放端口:内部端口
# --name docker中容器的名称
服务器的地址:3000
其实不看也知道,看中文都懂
docker stop yapi
docker start yapi
# 1、停止并删除旧版容器
docker rm -f yapi
# 2、获取最新镜像
docker pull registry.cn-hangzhou.aliyuncs.com/anoy/yapi
# 3、启动新容器
docker run -d --name yapi --link mongo-yapi:mongo --workdir /api/vendors -p 3000:3000 registry.cn-hangzhou.aliyuncs.com/anoy/yapi server/app.js
wget -o yapi.tar.gz https://github.com/YMFE/yapi/archive/v1.8.0.tar.gz
下载地址:https://github.com/YMFE/yapi/releases
Dockerfile
FROM node:12-alpine as builder
RUN apk add --no-cache git python make openssl tar gcc
COPY yapi.tar.gz /home
RUN cd /home && tar zxvf yapi.tar.gz && mkdir /api && mv /home/yapi-1.8.0 /api/vendors
RUN cd /api/vendors && npm install --production --registry https://registry.npm.taobao.org
FROM node:12-alpine
MAINTAINER 545544032@qq.com
ENV TZ="Asia/Shanghai" HOME="/"
WORKDIR ${HOME}
COPY --from=builder /api/vendors /api/vendors
COPY config.json /api/
EXPOSE 3000
ENTRYPOINT ["node"]
docker build -t yapi .
标签:阿里 link pytho 下载地址 device 索引 file oba 五步
原文地址:https://www.cnblogs.com/pythonywy/p/11910964.html