Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (52 sloc) 3.81 KB
---
title: Changing Stacks
owner:
- Buildpacks & Stacks
- Diego
- Runtime OG
---
<strong><%= modified_date %></strong>
A stack is a prebuilt root file system (rootfs) that supports a specific operating system. For example, Linux-based systems need `/usr` and `/bin` directories at their root. The stack works in tandem with a buildpack to support apps running in compartments. Under Diego architecture, cell VMs can support multiple stacks.
<p class="note"><strong>Note</strong>: Docker apps do not use stacks.</p>
##<a id='available-stacks'></a>Available Stacks ##
<%= vars.product_short %> <%= vars.current_major_version %> includes support for the following stacks:
* **cflinuxfs3**: The Linux `cflinuxfs3` stack is derived from Ubuntu Bionic 18.04.
Refer to the GitHub stacks page for supported [libraries](https://github.com/cloudfoundry/cflinuxfs3/blob/master/receipt.cflinuxfs3.x86_64).
* **cflinuxfs2**: The Linux `cflinuxfs2` stack is derived from Ubuntu Trusty 14.04.
Refer to the GitHub stacks page for supported [libraries](https://github.com/cloudfoundry/stacks/blob/master/cflinuxfs2/cflinuxfs2_receipt).
<p class="note breaking"><strong>Breaking Change</strong>: Support for Ubuntu Trusty 14.04 ends in April 2019.
Future versions of <%= vars.product_short %> may remove support for <code>cflinuxfs2</code>.
Push all new apps using <code>cflinuxfs3</code> and migrate existing apps to <code>cflinuxfs3</code> as soon as possible.
For more information about the Ubuntu support lifecycle, see the <a href="https://www.ubuntu.com/about/release-cycle">Canonical</a> documentation.</p>
<%= vars.custom_stack %>
##<a id='cli-commands'></a>Restaging Apps on a New Stack ##
For security, stacks receive regular updates to address Common Vulnerabilities and Exposures ([CVEs](http://www.ubuntu.com/usn/)). Apps pick up on these stack changes through new releases of <%= vars.product_short %>. However, if your app links statically to a library provided in the rootfs, you may have to manually restage it to pick up the changes.
It can be difficult to know what libraries an app statically links to, and it depends on the languages you are using. One example is an app that uses a Ruby or Python binary, and links out to part of the C standard library. If the C library requires an update, you may need to recompile the app and restage it as follows:
1. Use the [cf stacks](http://cli.cloudfoundry.org/en-US/cf/stacks.html) command to list the stacks available in a deployment.
<pre class='terminal'>
$ cf stacks
Getting stacks in org MY-ORG / space development as developer@example<span>.</span>com...
OK
name description
cflinuxfs2 Cloud Foundry Linux-based filesystem - Ubuntu Trusty 14.04 LTS
cflinuxfs3 Cloud Foundry Linux-based filesystem - Ubuntu Bionic 18.04 LTS
</pre>
1. To change your stack and restage your app, use the [cf push](http://cli.cloudfoundry.org/en-US/cf/push.html) command. For example, to restage your app on the stack `cflinuxfs3` you can run `cf push MY-APP -s cflinuxfs3`:
<pre class='terminal'>
$ cf push MY-APP -s cflinuxfs3
Using stack cflinuxfs3...
OK
Creating app MY-APP in org MY-ORG / space development as developer@example<span>.</span>com...
OK
...
requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: MY-APP.cfapps.io
last uploaded: Wed Apr 8 23:40:57 UTC 2015
state since cpu memory disk
\#0 running 2015-04-08 04:41:54 PM 0.0% 57.3M of 1G 128.8M of 1G
</pre>
To specify a different stack, replace `cflinuxfs3` with the name of the stack in the `-s STACKNAME` parameter of the command.
##<a id='stacks-api'></a>Stacks API ##
For API information, review the Stacks section of the [Cloud Foundry API Documentation](http://apidocs.cloudfoundry.org).