Skip to content

Heroku - 部署托管 docker 容器 ​

安装登陆 ​

安装 The Heroku CLI ​

Linux 安装

shell
curl https://cli-assets.heroku.com/install.sh | sh

npm 安装

shell
npm install -g heroku

检查版本

shell
heroku --version

登陆 ​

账号密码登陆

shell
heroku login -i

创建运行 ​

创建应用 ​

heroku create xxx

Container Registry & Runtime (Docker Deploys) ​

登陆

shell
heroku container:login

根据 Dockerfile 上传镜像

shell
heroku container:push web -a xxx
# Dockerfile 所在目录执行命令

发布镜像

shell
heroku container:release -a xxx web

查看日志

shell
heroku logs --app xxx

导出日志

shell
heroku logs --app subto -n 10000 > log
herokulogs && heroku logs --app subto -n 1000 > newlog ; fgrep -vf log newlog >> log

访问应用

shell
https://xxx.herokuapp.com

链接 ​