1.1 将应用作者的源码拷贝到本地
git clone [url]
- 举个例子:
git clone https://github.com/zmister2016/MrDoc
- 但是一般从GitHub上拉代码仓库不稳定,会提示失败,需要设置代理
解决方案:
参考 https://ghproxy.com/
git clone https://ghproxy.com/https://github.com/stilleshan/ServerStatus
1.2 使用源码中的 dockerfile 创建应用镜像
- 进入到 dockerfile 所在目录
- 使用 docker build 命令构建镜像
参考 https://www.runoob.com/docker/docker-build-command.html
docker build -t runoob/ubuntu:v1 .
- 构建成功之后,使用 docker images 查看镜像信息
1.3 改造作者的 docker-compose.yml 文件
- 修改里面的镜像名称、路径、端口号、管理员用户密码等信息,保存