From b06d37f88525c5688dd4e2ac099a4fd0eadd8d3c Mon Sep 17 00:00:00 2001 From: Gary Rennie Date: Thu, 20 Feb 2014 12:53:43 +0000 Subject: [PATCH] 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 --- README.md | 5 ++++- docs/django.md | 4 ++-- docs/fig.yml | 2 +- docs/index.md | 4 ++-- docs/rails.md | 4 ++-- docs/wordpress.md | 4 ++-- docs/yml.md | 6 ++++-- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1918d9b39..bd7d4515f 100644 --- a/README.md +++ b/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: diff --git a/docs/django.md b/docs/django.md index 476c0c2b6..8ecb3641e 100644 --- a/docs/django.md +++ b/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 diff --git a/docs/fig.yml b/docs/fig.yml index 45edcb3d1..30e8f6d9d 100644 --- a/docs/fig.yml +++ b/docs/fig.yml @@ -1,7 +1,7 @@ jekyll: build: . ports: - - 4000:4000 + - "4000:4000" volumes: - .:/code environment: diff --git a/docs/index.md b/docs/index.md index 64713244e..29b2a653d 100644 --- a/docs/index.md +++ b/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: diff --git a/docs/rails.md b/docs/rails.md index dca4dbe77..2dbf90033 100644 --- a/docs/rails.md +++ b/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 diff --git a/docs/wordpress.md b/docs/wordpress.md index 70ea9f620..a2f1bcf4a 100644 --- a/docs/wordpress.md +++ b/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 ``` diff --git a/docs/yml.md b/docs/yml.md index 2ae3c959a..283d41fc6 100644 --- a/docs/yml.md +++ b/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: