← 返回命令列表

Linux command

cf 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Login to Cloud Foundry

cf login -a [api.example.com]

Push application

cf push [app-name]

List applications

cf apps

View application logs

cf logs [app-name]

Scale application

cf scale [app-name] -i [3]

Create service instance

cf create-service [service] [plan] [name]

Bind service to app

cf bind-service [app-name] [service-name]

说明

cf is the Cloud Foundry CLI for managing applications and services on Cloud Foundry platforms. It handles the full application lifecycle including deployment, scaling, logging, and service binding across multiple cloud providers. Cloud Foundry uses a push-based deployment model where developers run `cf push` to upload application code, which is then built, containerized, and deployed automatically. Applications are organized into organizations and spaces, providing multi-tenant isolation. The CLI manages the interaction between developers and the Cloud Foundry API. Services such as databases, message queues, and caches are provisioned from a marketplace and bound to applications, with connection credentials injected via environment variables.

参数

-a _URL_
API endpoint URL
-u _user_
Username
-p _pass_
Password
-o _org_
Organization
-s _space_
Space
-i _num_
Number of instances
-m _memory_
Memory limit (e.g., 256M)
-f _manifest_
Path to manifest file
--skip-ssl-validation
Skip SSL certificate verification

FAQ

What is the cf command used for?

cf is the Cloud Foundry CLI for managing applications and services on Cloud Foundry platforms. It handles the full application lifecycle including deployment, scaling, logging, and service binding across multiple cloud providers. Cloud Foundry uses a push-based deployment model where developers run `cf push` to upload application code, which is then built, containerized, and deployed automatically. Applications are organized into organizations and spaces, providing multi-tenant isolation. The CLI manages the interaction between developers and the Cloud Foundry API. Services such as databases, message queues, and caches are provisioned from a marketplace and bound to applications, with connection credentials injected via environment variables.

How do I run a basic cf example?

Run `cf login -a [api.example.com]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a _URL_ do in cf?

API endpoint URL