• This repository has been archived on 28/Jan/2022
  • Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Stage and launch CF apps, push and pull droplets, and connect to real CF services -- in Docker

CF Local - cf CLI Plugin

Linux Build Status Windows Build Status GoDoc

CF Local Demo
Note: Image download/build only occurs when a new rootfs is available.

CF Local is a Cloud Foundry CLI plugin that enables you to:

  • Stage and run Cloud Foundry apps using Docker.
  • Pull running apps from a remote Cloud Foundry and run them with Docker.
  • Stage apps with Docker and push them to a remote Cloud Foundry.
  • Seamlessly inherit the service bindings of remotely running Cloud Foundry apps.
  • Seamlessly re-write service bindings to use persistent SSH tunnels through remote apps.
  • Develop Cloud Foundry apps in Docker using live-reload functionality backed by Docker volumes.
  • Rapidly iterate on Cloud Foundry apps without Cloud Foundry.
  • Convert Cloud Foundry apps into Docker images that only require Docker to run.

Notably, CF Local:

  • Does not require the Docker CLI
  • Can run against a remote Docker daemon
  • Uses the latest official Cloud Foundry buildpack releases by default
  • Always uses the latest Cloud Foundry rootfs (cflinuxfs3) release
  • Includes multi-buildpack support
  • Supports specifying buildpacks by name, zip URL, git URL, and local zip path
USAGE:
   cf local stage   <name> [ (-b <name> | -b <URL> | -b <zip>)... -e ]
                           [ (-p <dir> | -p <zip>) (-s <app> | -f <app>) ]
                           [ (-s <app> | -f <app>) ]
   cf local run     <name> [ (-i <ip>) (-p <port>) (-s <app>) (-f <app>) ]
                           [ (-d <dir> [-w] | (-d <dir>) [-t]) ]
   cf local export  <name> [ (-r <ref>) ]
   cf local pull    <name>
   cf local push    <name> [-e -k]
   cf local help
   cf local version

STAGE OPTIONS:
   stage <name>   Build a droplet using the app in the current directory and
                     the environment variables and service bindings specified
                     in local.yml.
                     Droplet filename: <name>.droplet

   -b <name>      Use one or more official CF buildpacks (specified by name).
                     Default: (uses detection)
   -b <url>       Use one or more buildpacks specified by git repository URL
                     or zip file URL (HTTP or HTTPS).
                     Default: (uses detection)
   -b <zip>       Use one or more buildpacks specified by local zip file path.
                     Default: (uses detection)
   -e             If buildpacks are explicitly specified then select one of
                     them using the buildpack detection process instead of
                     applying all of them using the multi-buildpack process.
                     Default: false
   -p <dir>       Use the specified directory as the app directory.
                     Default: current working directory
   -p <zip>       Use the specified ZIP file contents as the app directory.
                     Note that JAR and WAR files use ZIP file format.
                     Default: current working directory
   -s <app>       Use the service bindings from the specified remote CF app
                     instead of the service bindings in local.yml.
                     Default: (uses local.yml)
   -f <app>       Same as -s, but re-writes the service bindings to match
                     what they would be if they were tunneled through the app
                     with: cf local run <name> -f <app>
                     Default: (uses local.yml)

RUN OPTIONS:
   run <name>     Run a droplet with the configuration specified in local.yml.
                     Droplet filename: <name>.droplet

   -i <ip>        Listen on the specified interface IP
                     Default: localhost
   -p <port>      Listen on the specified port
                     Default: (arbitrary free port)
   -d <dir>       Replace the app directory with the specified directory.
                     The app directory from the droplet is ignored.
                     Default: (not mounted)
   -w             When used with -d, restart the app when the contents of the
                     specified directory are changed.
                     Default: false, Invalid: with -t, without -d
   -t             Start a shell (Bash) with the same environment as the app.
                     Default: false, Invalid: with -w
   -s <app>       Use the service bindings from the specified remote CF app
                     instead of the service bindings in local.yml.
                     Default: (uses local.yml or app provided by -f)
   -f <app>       Tunnel service connections through the specified remote CF
                     app. This re-writes the service bindings in the container
                     environment in order to use the tunnel. The service
                     bindings from the specified app will be used if -s is not
                     also passed.
                     Default: (uses local.yml)

EXPORT OPTIONS:
   export <name>  Export a standalone Docker image using the specified droplet
                     and configuration from local.yml.
                     Droplet filename: <name>.droplet

   -r <ref>       Tag the exported image with the provided reference.
                     Default: none

PULL OPTIONS:
   pull <name>    Download the droplet, environment variables, environment
                     variable groups, and start command of the named remote
                     CF app. The local.yml file is updated with the downloaded
                     configuration.
                     Droplet filename: <name>.droplet

PUSH OPTIONS:
   push <name>    Push a droplet to a remote CF app and restart the app.
                     Droplet filename: <name>.droplet

   -e             Additionally replace the remote app environment variables
                     with the environment variables from local.yml. This does
                     not read or replace environment variable groups.
                     Default: false
   -k             Do not restart the application after pushing the droplet.
                     The current droplet will continue to run until the next
                     restart.
                     Default: false

ENVIRONMENT:
   CFL_USE_PROXY  Always use or never use the environment's proxy settings.
                     Default: (use only when DOCKER_HOST is not set)
   DOCKER_HOST    Docker daemon address
                     Default: /var/run/docker.sock

SAMPLE: local.yml

applications:
- name: first-app
  buildpacks:
  - some_buildpack
  - some_other_buildpack
  command: "some start command"
  memory: 2G
  disk_quota: 4G
  staging_env:
    SOME_STAGING_VAR: "some staging value"
  running_env:
    SOME_RUNNING_VAR: "some running value"
  env:
    SOME_VAR: "some value"
  services:
    (( VCAP_SERVICES object in YAML ))

Install

From a Downloaded Release

$ ./cflocal-v0.19.0-macos
Plugin successfully installed. Current version: 0.19.0

Or

$ cf install-plugin cflocal-0.19.0-macos
Attention: Plugins are binaries written by potentially untrusted authors.
Install and use plugins at your own risk.
Do you want to install the plugin cflocal-0.19.0-macos? [yN]: y
Installing plugin cflocal...
OK
Plugin cflocal 0.19.0 successfully installed.

From the Community Plugin Repository

$ cf install-plugin cflocal
Searching CF-Community for plugin cflocal...
Plugin cflocal 0.19.0 found in: CF-Community
Attention: Plugins are binaries written by potentially untrusted authors.
Install and use plugins at your own risk.
Do you want to install the plugin cflocal? [yN]: y
Starting download of plugin binary from repository CF-Community...
 14.35 MiB / 14.35 MiB [=====================================] 100.00% 2s
Installing plugin cflocal...
OK
Plugin cflocal 0.19.0 successfully installed.

Note: This version is occasionally out of date. Furthermore, if you are using a version of the CF CLI prior to v6.27.0, you will need to specify the repository where the plugin is located:

$ cf install-plugin cflocal -r CF-Community

Uninstall

$ cf uninstall-plugin cflocal
Uninstalling plugin cflocal...
OK
Plugin cflocal successfully uninstalled.

Security Notes

  • Forwarded services (-f) are not reachable during staging.
  • Images are never exported with remote service credentials.
  • Service credentials from remote apps are never stored in local.yml.
  • CF Local should not be used to download untrusted Cloud Foundry applications.
  • CF Local is not intended for production use and is offered without warranty.
  • CF Local distribution archives are signed by me.

More Repositories

1

kubo-deployment

Contains manifests used to deploy Cloud Foundry Container Runtime
Shell
275
star
2

kubo-release

Kubernetes BOSH release
Ruby
160
star
3

docker-boshrelease

Docker BOSH Release
Shell
137
star
4

kubecf

Cloud Foundry on Kubernetes
Shell
115
star
5

admin-ui

Need new main contributor - An application for viewing Cloud Foundry metrics and operations data.
Ruby
71
star
6

fissile

Turn a BOSH release into container images / files
Go
67
star
7

spiff

declarative BOSH deployment manifest builder
Go
63
star
8

quarks-operator

BOSH releases deployed on Kubernetes
Go
49
star
9

bosh-alicloud-cpi-release

BOSH release for the BOSH Alibaba Cloud CPI.
Go
32
star
10

kubo-ci

Go
30
star
11

pat

Go
16
star
12

bits-service

Cloud Foundry Bits-Service repository
JavaScript
15
star
13

bosh-rackhd-cpi-release

BOSH RackHD CPI
Go
14
star
14

uaa-java-client

Java Client for Cloud Foundry UAA 2.x
Java
13
star
15

kubernetes-guidelines

Guidelines for developing applications running on top of Kubernetes
11
star
16

core-values-faq

11
star
17

NET-sample-app

A .NET sample app
ASP
10
star
18

uaago

UAA client for golang
Go
7
star
19

quarks-secret

Generate k8s secrets with an operator
Go
7
star
20

cf-plugin-backup

A Cloud Foundry Plugin that allows backup and restore of the CCDB using CF API
Go
7
star
21

asg-creator

Go
6
star
22

bits-service-release

BOSH release for Cloud Foundry Bits-Service
Ruby
5
star
23

bits-service-ci

Bits-Service CI Code
Shell
4
star
24

cf-extensions

CF-extensions hub project
Go
4
star
25

example-nozzle-release

BOSH release for the example-nozzle
Shell
4
star
26

quarks-job

Wrapper around k8s jobs that can store output and more
Go
4
star
27

uaa-go-client

UAA Client for Go!
Go
3
star
28

configgin

CLI app to generate configurations using BOSH ERB templates
Ruby
3
star
29

eirini-persi

Persi support for Eirini, using eirinix
Go
3
star
30

cf-prometheus-operator

Go
3
star
31

kubernetes-release

Shell
2
star
32

cfcr-home

Shell
2
star
33

backup-and-restore-ci

Platform Recovery CI
Shell
2
star
34

cfcr-etcd-release

Shell
2
star
35

eirini-loggregator-bridge

Component that streams logs from Eirini apps to the Cloud Foundry Loggregator
Go
2
star
36

go-stream-aggregator

Go
2
star
37

eirini-ssh

Support for "ssh to app" for Cloud Foundry Eirini
Go
2
star
38

bosh-oracle-cpi-release

Go
2
star
39

garden-windows-bosh-release

PowerShell
2
star
40

eirinix

Extensions Library for Cloud Foundry Eirini
Go
2
star
41

thoth

An App responsible for measuring and controlling time
Go
2
star
42

bosh-huaweicloud-cpi-release

Ruby
2
star
43

quarks-gora-release

HTML
1
star
44

cf-telegraf-operator

Go
1
star
45

quarks-gora

Go
1
star
46

quarks-helm

1
star
47

eirinix-sample

Sample extension for Eirini, created with the eirinix framework
Go
1
star
48

quarks-ci

Shell
1
star
49

example-nozzle

Example loggregator firehose nozzle
Go
1
star
50

log-cache-tools

Go
1
star
51

grpc-throughputlb

Go
1
star
52

eirinix-helm-release

Ruby
1
star
53

kubo-disaster-recovery-acceptance-tests

Go
1
star
54

buildpacks-site

JavaScript
1
star
55

eirini-staging

Go
1
star
56

quarks-docs

The shared documentation for Quarks
HTML
1
star
57

bits-service-client

Ruby client for the bits-service
Ruby
1
star
58

quarks-statefulset

Wrapper around k8s statefulset with various features
Go
1
star
59

quarks-container-run

Go
1
star
60

concourse-cve-scan

Shell
1
star
61

kubecf-tools

A set of tools for building, testing and releasing projects that are deployed on Kubernetes
Ruby
1
star
62

eirini-helm-release

1
star
63

push-apps

A jar to aide in CI or Bosh jobs that have to push many applications to CF
Kotlin
1
star
64

eirini-persi-broker

Service Broker for provisioning volumes for Eirini on Kubernetes
Go
1
star
65

quarks-utils

Shared utilities for Quarks-* operators
Go
1
star
66

eirini-logging

App logging extension
Go
1
star