update
This commit is contained in:
parent
827811d664
commit
8903a5508f
9 changed files with 49 additions and 31 deletions
2
cli.html
2
cli.html
|
|
@ -6,7 +6,7 @@
|
|||
<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?20140228081933111372101">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140303091963271416714">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<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?20140228081933111372101">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140303091963271416714">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -30,7 +30,7 @@ ADD requirements.txt /code/
|
|||
RUN pip install -r requirements.txt
|
||||
ADD . /code/
|
||||
</code></pre></div>
|
||||
<p>That'll install our application inside an image with Python installed alongside all of our Python dependencies. For more information on how to write Dockerfiles, see the <a href="https://www.docker.io/learn/dockerfile/">Dockerfile tutorial</a> and the <a href="http://docs.docker.io/en/latest/use/builder/">Dockerfile reference</a>.</p>
|
||||
<p>That'll install our application inside an image with Python installed alongside all of our Python dependencies. For more information on how to write Dockerfiles, see the <a href="https://www.docker.io/learn/dockerfile/">Dockerfile tutorial</a> and the <a href="http://docs.docker.io/en/latest/reference/builder/">Dockerfile reference</a>.</p>
|
||||
|
||||
<p>Second, we define our Python dependencies in a file called <code>requirements.txt</code>:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">Django
|
||||
|
|
@ -39,14 +39,14 @@ ADD . /code/
|
|||
<div class="highlight"><pre><code class="text language-text" data-lang="text">db:
|
||||
image: orchardup/postgresql
|
||||
ports:
|
||||
- 5432
|
||||
- "5432"
|
||||
web:
|
||||
build: .
|
||||
command: python manage.py runserver 0.0.0.0:8000
|
||||
volumes:
|
||||
- .:/code
|
||||
ports:
|
||||
- 8000:8000
|
||||
- "8000:8000"
|
||||
links:
|
||||
- db
|
||||
</code></pre></div>
|
||||
|
|
|
|||
2
env.html
2
env.html
|
|
@ -6,7 +6,7 @@
|
|||
<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?20140228081933111372101">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140303091963271416714">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
|
|||
2
fig.yml
2
fig.yml
|
|
@ -1,7 +1,7 @@
|
|||
jekyll:
|
||||
build: .
|
||||
ports:
|
||||
- 4000:4000
|
||||
- "4000:4000"
|
||||
volumes:
|
||||
- .:/code
|
||||
environment:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<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?20140228081933111372101">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140303091963271416714">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -32,7 +32,7 @@ RUN pip install -r requirements.txt
|
|||
<span class="l-Scalar-Plain">links</span><span class="p-Indicator">:</span>
|
||||
<span class="p-Indicator">-</span> <span class="l-Scalar-Plain">db</span>
|
||||
<span class="l-Scalar-Plain">ports</span><span class="p-Indicator">:</span>
|
||||
<span class="p-Indicator">-</span> <span class="l-Scalar-Plain">8000:8000</span>
|
||||
<span class="p-Indicator">-</span> <span class="s">"8000:8000"</span>
|
||||
<span class="l-Scalar-Plain">db</span><span class="p-Indicator">:</span>
|
||||
<span class="l-Scalar-Plain">image</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">orchardup/postgresql</span>
|
||||
</code></pre></div>
|
||||
|
|
@ -101,14 +101,14 @@ ADD . /code
|
|||
WORKDIR /code
|
||||
RUN pip install -r requirements.txt
|
||||
</code></pre></div>
|
||||
<p>This tells Docker to install Python, our code and our Python dependencies inside a Docker image. For more information on how to write Dockerfiles, see the <a href="https://www.docker.io/learn/dockerfile/">Dockerfile tutorial</a> and the <a href="http://docs.docker.io/en/latest/use/builder/">Dockerfile reference</a>.</p>
|
||||
<p>This tells Docker to install Python, our code and our Python dependencies inside a Docker image. For more information on how to write Dockerfiles, see the <a href="https://www.docker.io/learn/dockerfile/">Dockerfile tutorial</a> and the <a href="http://docs.docker.io/en/latest/reference/builder/">Dockerfile reference</a>.</p>
|
||||
|
||||
<p>We then define a set of services using <code>fig.yml</code>:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">web:
|
||||
build: .
|
||||
command: python app.py
|
||||
ports:
|
||||
- 5000:5000
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
- .:/code
|
||||
links:
|
||||
|
|
|
|||
16
install.html
16
install.html
|
|
@ -6,7 +6,7 @@
|
|||
<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?20140228081933111372101">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140303091963271416714">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -19,18 +19,24 @@
|
|||
|
||||
<div class="content"><h1>Installing Fig</h1>
|
||||
|
||||
<p>First, install Docker. If you're on OS X, you can use <a href="https://github.com/noplay/docker-osx">docker-osx</a>:</p>
|
||||
<p>First, install Docker (version 0.8 or higher). If you're on OS X, you can use <a href="https://github.com/noplay/docker-osx">docker-osx</a>:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ curl https://raw.github.com/noplay/docker-osx/0.8.0/docker-osx > /usr/local/bin/docker-osx
|
||||
$ chmod +x /usr/local/bin/docker-osx
|
||||
$ docker-osx shell
|
||||
</code></pre></div>
|
||||
<p>Docker has guides for <a href="http://docs.docker.io/en/latest/installation/ubuntulinux/">Ubuntu</a> and <a href="http://docs.docker.io/en/latest/installation/">other platforms</a> in their documentation.</p>
|
||||
|
||||
<p>Next, install Fig:</p>
|
||||
<p>Next, install Fig. On OS X:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ curl -L https://github.com/orchardup/fig/releases/download/0.3.0/darwin > /usr/local/bin/fig
|
||||
$ chmod +x /usr/local/bin/fig
|
||||
</code></pre></div>
|
||||
<p>On 64-bit Linux:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ curl -L https://github.com/orchardup/fig/releases/download/0.3.0/linux > /usr/local/bin/fig
|
||||
$ chmod +x /usr/local/bin/fig
|
||||
</code></pre></div>
|
||||
<p>Fig is also available as a Python package if you're on another platform (or if you prefer that sort of thing):</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">$ sudo pip install -U fig
|
||||
</code></pre></div>
|
||||
<p>(This command also upgrades Fig when we release a new version. If you don’t have pip installed, try <code>brew install python</code> or <code>apt-get install python-pip</code>.)</p>
|
||||
|
||||
<p>That should be all you need! Run <code>fig --version</code> to see if it worked.</p>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<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?20140228081933111372101">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140303091963271416714">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -30,7 +30,7 @@ ADD Gemfile /myapp/Gemfile
|
|||
RUN bundle install
|
||||
ADD . /myapp
|
||||
</code></pre></div>
|
||||
<p>That'll put our application code inside an image with Ruby, Bundler and all our dependencies. For more information on how to write Dockerfiles, see the <a href="https://www.docker.io/learn/dockerfile/">Dockerfile tutorial</a> and the <a href="http://docs.docker.io/en/latest/use/builder/">Dockerfile reference</a>.</p>
|
||||
<p>That'll put our application code inside an image with Ruby, Bundler and all our dependencies. For more information on how to write Dockerfiles, see the <a href="https://www.docker.io/learn/dockerfile/">Dockerfile tutorial</a> and the <a href="http://docs.docker.io/en/latest/reference/builder/">Dockerfile reference</a>.</p>
|
||||
|
||||
<p>Next, we have a bootstrap <code>Gemfile</code> which just loads Rails. It'll be overwritten in a moment by <code>rails new</code>.</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">source 'https://rubygems.org'
|
||||
|
|
@ -40,14 +40,14 @@ gem 'rails', '4.0.2'
|
|||
<div class="highlight"><pre><code class="text language-text" data-lang="text">db:
|
||||
image: orchardup/postgresql
|
||||
ports:
|
||||
- 5432
|
||||
- "5432"
|
||||
web:
|
||||
build: .
|
||||
command: bundle exec rackup -p 3000
|
||||
volumes:
|
||||
- .:/myapp
|
||||
ports:
|
||||
- 3000:3000
|
||||
- "3000:3000"
|
||||
links:
|
||||
- db
|
||||
</code></pre></div>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<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?20140228081933111372101">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140303091963271416714">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -26,14 +26,14 @@
|
|||
<div class="highlight"><pre><code class="text language-text" data-lang="text">FROM orchardup/php5
|
||||
ADD . /code
|
||||
</code></pre></div>
|
||||
<p>This instructs Docker on how to build an image that contains PHP and Wordpress. For more information on how to write Dockerfiles, see the <a href="https://www.docker.io/learn/dockerfile/">Dockerfile tutorial</a> and the <a href="http://docs.docker.io/en/latest/use/builder/">Dockerfile reference</a>.</p>
|
||||
<p>This instructs Docker on how to build an image that contains PHP and Wordpress. For more information on how to write Dockerfiles, see the <a href="https://www.docker.io/learn/dockerfile/">Dockerfile tutorial</a> and the <a href="http://docs.docker.io/en/latest/reference/builder/">Dockerfile reference</a>.</p>
|
||||
|
||||
<p>Next up, <code>fig.yml</code> starts our web service and a separate MySQL instance:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">web:
|
||||
build: .
|
||||
command: php -S 0.0.0.0:8000 -t /code
|
||||
ports:
|
||||
- 8000:8000
|
||||
- "8000:8000"
|
||||
links:
|
||||
- db
|
||||
volumes:
|
||||
|
|
@ -41,7 +41,7 @@ ADD . /code
|
|||
db:
|
||||
image: orchardup/mysql
|
||||
ports:
|
||||
- 3306:3306
|
||||
- "3306:3306"
|
||||
environment:
|
||||
MYSQL_DATABASE: wordpress
|
||||
</code></pre></div>
|
||||
|
|
|
|||
26
yml.html
26
yml.html
|
|
@ -6,7 +6,7 @@
|
|||
<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?20140228081933111372101">
|
||||
<link rel="stylesheet" type="text/css" href="css/fig.css?20140303091963271416714">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
|
@ -22,26 +22,38 @@
|
|||
<p>Each service defined in <code>fig.yml</code> must specify exactly one of <code>image</code> or <code>build</code>. Other keys are optional, and are analogous to their <code>docker run</code> command-line counterparts.</p>
|
||||
|
||||
<p>As with <code>docker run</code>, options specified in the Dockerfile (e.g. <code>CMD</code>, <code>EXPOSE</code>, <code>VOLUME</code>, <code>ENV</code>) are respected by default - you don't need to specify them again in <code>fig.yml</code>.</p>
|
||||
<div class="highlight"><pre><code class="yaml language-yaml" data-lang="yaml"><span class="l-Scalar-Plain">-- Tag or partial image ID. Can be local or remote - Fig will attempt to pull if it doesn't exist locally.</span>
|
||||
<div class="highlight"><pre><code class="yaml language-yaml" data-lang="yaml"><span class="l-Scalar-Plain">-- Tag or partial image ID. Can be local or remote - Fig will attempt to pull</span>
|
||||
<span class="l-Scalar-Plain">-- if it doesn't exist locally.</span>
|
||||
<span class="l-Scalar-Plain">image</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">ubuntu</span>
|
||||
<span class="l-Scalar-Plain">image</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">orchardup/postgresql</span>
|
||||
<span class="l-Scalar-Plain">image</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">a4bc65fd</span>
|
||||
|
||||
<span class="l-Scalar-Plain">-- Path to a directory containing a Dockerfile. Fig will build and tag it with a generated name, and use that image thereafter.</span>
|
||||
<span class="l-Scalar-Plain">-- Path to a directory containing a Dockerfile. Fig will build and tag it with</span>
|
||||
<span class="l-Scalar-Plain">-- a generated name, and use that image thereafter.</span>
|
||||
<span class="l-Scalar-Plain">build</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">/path/to/build/dir</span>
|
||||
|
||||
<span class="l-Scalar-Plain">-- Override the default command.</span>
|
||||
<span class="l-Scalar-Plain">command</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">bundle exec thin -p 3000</span>
|
||||
|
||||
<span class="l-Scalar-Plain">-- Link to containers in another service (see "Communicating between containers").</span>
|
||||
<span class="l-Scalar-Plain">-- Link to containers in another service. Optionally specify an alternate name</span>
|
||||
<span class="l-Scalar-Plain">-- for the link, which will determine how environment variables are prefixed,</span>
|
||||
<span class="l-Scalar-Plain">-- e.g. "db" -> DB_1_PORT, "db:database" -> DATABASE_1_PORT</span>
|
||||
<span class="l-Scalar-Plain">links</span><span class="p-Indicator">:</span>
|
||||
<span class="p-Indicator">-</span> <span class="l-Scalar-Plain">db</span>
|
||||
<span class="p-Indicator">-</span> <span class="l-Scalar-Plain">db:database</span>
|
||||
<span class="p-Indicator">-</span> <span class="l-Scalar-Plain">redis</span>
|
||||
|
||||
<span class="l-Scalar-Plain">-- Expose ports. Either specify both ports (HOST:CONTAINER), or just the container port (a random host port will be chosen).</span>
|
||||
<span class="l-Scalar-Plain">-- Expose ports. Either specify both ports (HOST:CONTAINER), or just the</span>
|
||||
<span class="l-Scalar-Plain">-- container port (a random host port will be chosen).</span>
|
||||
<span class="l-Scalar-Plain">-- Note</span><span class="p-Indicator">:</span> <span class="l-Scalar-Plain">When mapping ports in the HOST:CONTAINER format, you may experience</span>
|
||||
<span class="l-Scalar-Plain">-- erroneous results when using a container port lower than 60, because YAML</span>
|
||||
<span class="l-Scalar-Plain">-- will parse numbers in the format "xx:yy" as sexagesimal (base 60). For</span>
|
||||
<span class="l-Scalar-Plain">-- this reason, we recommend always explicitly specifying your port mappings</span>
|
||||
<span class="l-Scalar-Plain">-- as strings.</span>
|
||||
<span class="l-Scalar-Plain">ports</span><span class="p-Indicator">:</span>
|
||||
<span class="p-Indicator">-</span> <span class="l-Scalar-Plain">3000</span>
|
||||
<span class="p-Indicator">-</span> <span class="l-Scalar-Plain">8000:8000</span>
|
||||
<span class="p-Indicator">-</span> <span class="s">"3000"</span>
|
||||
<span class="p-Indicator">-</span> <span class="s">"8000:8000"</span>
|
||||
<span class="p-Indicator">-</span> <span class="s">"49100:22"</span>
|
||||
|
||||
<span class="l-Scalar-Plain">-- Map volumes from the host machine (HOST:CONTAINER).</span>
|
||||
<span class="l-Scalar-Plain">volumes</span><span class="p-Indicator">:</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue