138 lines
5.7 KiB
HTML
138 lines
5.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en-gb">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Fig CLI reference</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link href='http://fonts.googleapis.com/css?family=Lilita+One|Lato:300,400,700' rel='stylesheet' type='text/css'>
|
|
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
|
|
<link rel="stylesheet" type="text/css" href="css/fig.css?20140204052352154161027">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="logo mobile-logo">
|
|
<a href="index.html">
|
|
<img src="img/logo.png">
|
|
Fig
|
|
</a>
|
|
</div>
|
|
|
|
<div class="content"><h1>CLI reference</h1>
|
|
|
|
<p>Most commands are run against one or more services. If the service is omitted, it will apply to all services.</p>
|
|
|
|
<p>Run <code>fig [COMMAND] --help</code> for full usage.</p>
|
|
|
|
<h2>build</h2>
|
|
|
|
<p>Build or rebuild services.</p>
|
|
|
|
<p>Services are built once and then tagged as <code>project_service</code>, e.g. <code>figtest_db</code>. If you change a service's <code>Dockerfile</code> or the contents of its build directory, you can run <code>fig build</code> to rebuild it.</p>
|
|
|
|
<h2>help</h2>
|
|
|
|
<p>Get help on a command.</p>
|
|
|
|
<h2>kill</h2>
|
|
|
|
<p>Force stop service containers.</p>
|
|
|
|
<h2>logs</h2>
|
|
|
|
<p>View output from services.</p>
|
|
|
|
<h2>ps</h2>
|
|
|
|
<p>List containers.</p>
|
|
|
|
<h2>rm</h2>
|
|
|
|
<p>Remove stopped service containers.</p>
|
|
|
|
<h2>run</h2>
|
|
|
|
<p>Run a one-off command on a service.</p>
|
|
|
|
<p>For example:</p>
|
|
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ fig run web python manage.py shell
|
|
</code></pre></div>
|
|
<p>Note that this will not start any services that the command's service links to. So if, for example, your one-off command talks to your database, you will need to run <code>fig up -d db</code> first.</p>
|
|
|
|
<p>One-off commands are started in new containers with the same config as a normal container for that service, so volumes, links, etc will all be created as expected. The only thing different to a normal container is the command will be overridden with the one specified and no ports will be created in case they collide.</p>
|
|
|
|
<p>Links are also created between one-off commands and the other containers for that service so you can do stuff like this:</p>
|
|
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ fig run db /bin/sh -c "psql -h \$DB_1_PORT_5432_TCP_ADDR -U docker"
|
|
</code></pre></div>
|
|
<h2>scale</h2>
|
|
|
|
<p>Set number of containers to run for a service.</p>
|
|
|
|
<p>Numbers are specified in the form <code>service=num</code> as arguments.
|
|
For example:</p>
|
|
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ fig scale web=2 worker=3
|
|
</code></pre></div>
|
|
<h2>start</h2>
|
|
|
|
<p>Start existing containers for a service.</p>
|
|
|
|
<h2>stop</h2>
|
|
|
|
<p>Stop running containers without removing them. They can be started again with <code>fig start</code>.</p>
|
|
|
|
<h2>up</h2>
|
|
|
|
<p>Build, (re)create, start and attach to containers for a service.</p>
|
|
|
|
<p>By default, <code>fig up</code> will aggregate the output of each container, and when it exits, all containers will be stopped. If you run <code>fig up -d</code>, it'll start the containers in the background and leave them running.</p>
|
|
|
|
<p>If there are existing containers for a service, <code>fig up</code> will stop and recreate them (preserving mounted volumes with <a href="http://docs.docker.io/en/latest/use/working_with_volumes/">volumes-from</a>), so that changes in <code>fig.yml</code> are picked up.</p>
|
|
</div>
|
|
|
|
<div class="sidebar">
|
|
<h1 class="logo">
|
|
<a href="index.html">
|
|
<img src="img/logo.png">
|
|
Fig
|
|
</a>
|
|
</h1>
|
|
|
|
<ul class="nav">
|
|
<li><a href="index.html">Home</a></li>
|
|
<li><a href="install.html">Install</a></li>
|
|
<li><a href="rails.html">Get started with Rails</a></li>
|
|
<li><a href="django.html">Get started with Django</a></li>
|
|
<li><a href="wordpress.html">Get started with Wordpress</a></li>
|
|
</ul>
|
|
<ul class="nav">
|
|
<li>Reference:</li>
|
|
<ul>
|
|
<li><a href="yml.html">fig.yml</a></li>
|
|
<li><a href="cli.html">Commands</a></li>
|
|
<li><a href="env.html">Environment variables</a></li>
|
|
</ul>
|
|
</ul>
|
|
<ul class="nav">
|
|
<li><a href="https://github.com/orchardup/fig">Fig on GitHub</a></li>
|
|
<li><a href="https://twitter.com/orchardup">Follow us on Twitter</a></li>
|
|
<li><a href="http://webchat.freenode.net/?channels=%23orchardup&uio=d4">#orchardup on Freenode</a></li>
|
|
</ul>
|
|
|
|
<div class="badges">
|
|
<iframe src="http://ghbtns.com/github-btn.html?user=orchardup&repo=fig&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
|
|
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://orchardup.github.io/fig/">Tweet</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
|
<script>
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
|
|
ga('create', 'UA-43996733-3', 'orchardup.github.io');
|
|
ga('send', 'pageview');
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|