Browse Source

Documentation: Include notes on mapping ports

When mapping ports as strings there is an issue with the way YAML parses
numbers in the format "xx:yy" where yy is less than 60 - this issue is
now included in the documentation.

This fixes #103
Gary Rennie 11 years ago
parent
commit
b06d37f885
7 changed files with 17 additions and 12 deletions
  1. 4 1
      README.md
  2. 2 2
      docs/django.md
  3. 1 1
      docs/fig.yml
  4. 2 2
      docs/index.md
  5. 2 2
      docs/rails.md
  6. 2 2
      docs/wordpress.md
  7. 4 2
      docs/yml.md

+ 4 - 1
README.md

@@ -22,11 +22,14 @@ web:
   links:
    - db
   ports:
-   - 8000:8000
+   - "8000:8000"
+   - "49100:22"
 db:
   image: orchardup/postgresql
 ```
 
+**Note** When mapping ports in the format HOST:CONTAINER you may experience erroneous results when using a container port lower than 60. This is due to YAML parsing numbers in the format "xx:yy" as sexagesimal (base 60) for this reason it is recommended to define your port mappings as strings.
+
 (No more installing Postgres on your laptop!)
 
 Then type `fig up`, and Fig will start and run your entire app:

+ 2 - 2
docs/django.md

@@ -29,14 +29,14 @@ Simple enough. Finally, this is all tied together with a file called `fig.yml`.
     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
 

+ 1 - 1
docs/fig.yml

@@ -1,7 +1,7 @@
 jekyll:
   build: .
   ports:
-   - 4000:4000
+   - "4000:4000"
   volumes:
    - .:/code
   environment:

+ 2 - 2
docs/index.md

@@ -21,7 +21,7 @@ web:
   links:
    - db
   ports:
-   - 8000:8000
+   - "8000:8000"
 db:
   image: orchardup/postgresql
 ```
@@ -107,7 +107,7 @@ We then define a set of services using `fig.yml`:
       build: .
       command: python app.py
       ports:
-       - 5000:5000
+       - "5000:5000"
       volumes:
        - .:/code
       links:

+ 2 - 2
docs/rails.md

@@ -30,14 +30,14 @@ Finally, `fig.yml` is where the magic happens. It describes what services our ap
     db:
       image: orchardup/postgresql
       ports:
-        - 5432
+        - "5432"
     web:
       build: .
       command: bundle exec rackup -p 3000
       volumes:
         - .:/myapp
       ports:
-        - 3000:3000
+        - "3000:3000"
       links:
         - db
 

+ 2 - 2
docs/wordpress.md

@@ -26,7 +26,7 @@ web:
   build: .
   command: php -S 0.0.0.0:8000 -t /code
   ports:
-    - 8000:8000
+    - "8000:8000"
   links:
     - db
   volumes:
@@ -34,7 +34,7 @@ web:
 db:
   image: orchardup/mysql
   ports:
-    - 3306:3306
+    - "3306:3306"
   environment:
     MYSQL_DATABASE: wordpress
 ```

+ 4 - 2
docs/yml.md

@@ -28,9 +28,11 @@ links:
  - redis
 
 -- 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 format HOST:CONTAINER you may experience erroneous results when using a container port lower than 60. This is due to YAML parsing numbers in the format "xx:yy" as sexagesimal (base 60) for this reason it is recommended to define your port mappings as strings.
 ports:
- - 3000
- - 8000:8000
+ - "3000"
+ - "8000:8000"
+ - "49100:22"
 
 -- Map volumes from the host machine (HOST:CONTAINER).
 volumes: