From 8903a5508f3d1df59eba9d2b32f4934b7361ec56 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Mon, 3 Mar 2014 19:33:17 +0000 Subject: [PATCH] update --- cli.html | 2 +- django.html | 8 ++++---- env.html | 2 +- fig.yml | 2 +- index.html | 8 ++++---- install.html | 16 +++++++++++----- rails.html | 8 ++++---- wordpress.html | 8 ++++---- yml.html | 26 +++++++++++++++++++------- 9 files changed, 49 insertions(+), 31 deletions(-) diff --git a/cli.html b/cli.html index 02438197..cee66ac9 100644 --- a/cli.html +++ b/cli.html @@ -6,7 +6,7 @@ - +
diff --git a/django.html b/django.html index 8cff1ea4..14f458c2 100644 --- a/django.html +++ b/django.html @@ -6,7 +6,7 @@ - +
@@ -30,7 +30,7 @@ ADD requirements.txt /code/ RUN pip install -r requirements.txt ADD . /code/
-

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 Dockerfile tutorial and the Dockerfile reference.

+

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 Dockerfile tutorial and the Dockerfile reference.

Second, we define our Python dependencies in a file called requirements.txt:

Django
@@ -39,14 +39,14 @@ ADD . /code/
 
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
 
diff --git a/env.html b/env.html index 42aa007a..395ce6ce 100644 --- a/env.html +++ b/env.html @@ -6,7 +6,7 @@ - +
diff --git a/fig.yml b/fig.yml index 45edcb3d..30e8f6d9 100644 --- a/fig.yml +++ b/fig.yml @@ -1,7 +1,7 @@ jekyll: build: . ports: - - 4000:4000 + - "4000:4000" volumes: - .:/code environment: diff --git a/index.html b/index.html index 38f46fee..711bfaa1 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - +
@@ -32,7 +32,7 @@ RUN pip install -r requirements.txt links: - db ports: - - 8000:8000 + - "8000:8000" db: image: orchardup/postgresql
@@ -101,14 +101,14 @@ ADD . /code WORKDIR /code RUN pip install -r requirements.txt
-

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 Dockerfile tutorial and the Dockerfile reference.

+

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 Dockerfile tutorial and the Dockerfile reference.

We then define a set of services using fig.yml:

web:
   build: .
   command: python app.py
   ports:
-   - 5000:5000
+   - "5000:5000"
   volumes:
    - .:/code
   links:
diff --git a/install.html b/install.html
index ccba6780..63535820 100644
--- a/install.html
+++ b/install.html
@@ -6,7 +6,7 @@
     
     
     
-    
+    
   
   
     
@@ -19,18 +19,24 @@

Installing Fig

-

First, install Docker. If you're on OS X, you can use docker-osx:

+

First, install Docker (version 0.8 or higher). If you're on OS X, you can use docker-osx:

$ 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
 

Docker has guides for Ubuntu and other platforms in their documentation.

-

Next, install Fig:

+

Next, install Fig. On OS X:

+
$ curl -L https://github.com/orchardup/fig/releases/download/0.3.0/darwin > /usr/local/bin/fig
+$ chmod +x /usr/local/bin/fig
+
+

On 64-bit Linux:

+
$ curl -L https://github.com/orchardup/fig/releases/download/0.3.0/linux > /usr/local/bin/fig
+$ chmod +x /usr/local/bin/fig
+
+

Fig is also available as a Python package if you're on another platform (or if you prefer that sort of thing):

$ sudo pip install -U fig
 
-

(This command also upgrades Fig when we release a new version. If you don’t have pip installed, try brew install python or apt-get install python-pip.)

-

That should be all you need! Run fig --version to see if it worked.

diff --git a/rails.html b/rails.html index e661b044..7075d145 100644 --- a/rails.html +++ b/rails.html @@ -6,7 +6,7 @@ - +
@@ -30,7 +30,7 @@ ADD Gemfile /myapp/Gemfile RUN bundle install ADD . /myapp
-

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 Dockerfile tutorial and the Dockerfile reference.

+

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 Dockerfile tutorial and the Dockerfile reference.

Next, we have a bootstrap Gemfile which just loads Rails. It'll be overwritten in a moment by rails new.

source 'https://rubygems.org'
@@ -40,14 +40,14 @@ gem 'rails', '4.0.2'
 
db:
   image: orchardup/postgresql
   ports:
-    - 5432
+    - "5432"
 web:
   build: .
   command: bundle exec rackup -p 3000
   volumes:
     - .:/myapp
   ports:
-    - 3000:3000
+    - "3000:3000"
   links:
     - db
 
diff --git a/wordpress.html b/wordpress.html index 53bb2ca4..56749308 100644 --- a/wordpress.html +++ b/wordpress.html @@ -6,7 +6,7 @@ - +
@@ -26,14 +26,14 @@
FROM orchardup/php5
 ADD . /code
 
-

This instructs Docker on how to build an image that contains PHP and Wordpress. For more information on how to write Dockerfiles, see the Dockerfile tutorial and the Dockerfile reference.

+

This instructs Docker on how to build an image that contains PHP and Wordpress. For more information on how to write Dockerfiles, see the Dockerfile tutorial and the Dockerfile reference.

Next up, fig.yml starts our web service and a separate MySQL instance:

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
 
diff --git a/yml.html b/yml.html index b98fab96..62a0f9bf 100644 --- a/yml.html +++ b/yml.html @@ -6,7 +6,7 @@ - +
@@ -22,26 +22,38 @@

Each service defined in fig.yml must specify exactly one of image or build. Other keys are optional, and are analogous to their docker run command-line counterparts.

As with docker run, options specified in the Dockerfile (e.g. CMD, EXPOSE, VOLUME, ENV) are respected by default - you don't need to specify them again in fig.yml.

-
-- Tag or partial image ID. Can be local or remote - Fig will attempt to pull if it doesn't exist locally.
+
-- Tag or partial image ID. Can be local or remote - Fig will attempt to pull
+-- if it doesn't exist locally.
 image: ubuntu
 image: orchardup/postgresql
 image: a4bc65fd
 
--- Path to a directory containing a Dockerfile. Fig will build and tag it with a generated name, and use that image thereafter.
+-- Path to a directory containing a Dockerfile. Fig will build and tag it with
+-- a generated name, and use that image thereafter.
 build: /path/to/build/dir
 
 -- Override the default command.
 command: bundle exec thin -p 3000
 
--- Link to containers in another service (see "Communicating between containers").
+-- Link to containers in another service. Optionally specify an alternate name
+-- for the link, which will determine how environment variables are prefixed,
+-- e.g. "db" -> DB_1_PORT, "db:database" -> DATABASE_1_PORT
 links:
  - db
+ - db:database
  - redis
 
--- Expose ports. Either specify both ports (HOST:CONTAINER), or just the container port (a random host port will be chosen).
+-- Expose ports. Either specify both ports (HOST:CONTAINER), or just the
+-- container port (a random host port will be chosen).
+-- Note: When mapping ports in the HOST:CONTAINER format, you may experience
+-- erroneous results when using a container port lower than 60, because YAML
+-- will parse numbers in the format "xx:yy" as sexagesimal (base 60). For
+-- this reason, we recommend always explicitly specifying your port mappings
+-- as strings.
 ports:
- - 3000
- - 8000:8000
+ - "3000"
+ - "8000:8000"
+ - "49100:22"
 
 -- Map volumes from the host machine (HOST:CONTAINER).
 volumes: