安装

linux

1
curl -L https://fly.io/install.sh | sh

windows

使用powershell:

1
pwsh -Command "iwr https://fly.io/install.ps1 -useb | iex"

macOS

1
brew install flyctl

升级

1
fly version upgrade

部署app

第一次启动

1
fly launch

重新部署

1
fly deploy

使用远程docker镜像

默认使用本地文件夹内的 Dockerfile

1
fly launch --remote-only --image xxx/xxx:xxx

批量添加环境变量

1
fly secrets import --app APP_NAME < .env

.env格式:

1
2
3
XXX=xxx
YYY=yyy
...

重新生成fly.toml

1
fly config save -a APP_NAME

查看所有app

1
fly app list

fly app 命令操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Usage:
flyctl apps [command]

Aliases:
apps, app

Available Commands:
create Create a new application
destroy Permanently destroys an app
errors View application errors on Sentry.io
list List applications
move Move an app to another organization
open Open browser to current deployed application
releases List app releases
restart Restart an application