- Remove extraneous '-' in sudo note.
- Correct space formatting (minor).
- Simplify instructions for install EPEL and install with yum directly.
- Add `nodejs` to yum install list explicitly to match the comments -- more transparent for new users who might not be clear `npm` package also installs `nodejs`.
- Remove '--noprealloc` from MongoDB example as the option has been depcated since Mongo 2.6 and is now the default behaviour. See: http://docs.mongodb.org/manual/reference/program/mongod/
Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
| ... | ... |
@@ -10,9 +10,8 @@ parent = "smn_third_party" |
| 10 | 10 |
|
| 11 | 11 |
# Using Supervisor with Docker |
| 12 | 12 |
|
| 13 |
-> **Note**: |
|
| 14 |
-> - **If you don't like sudo** then see [*Giving non-root |
|
| 15 |
-> access*](/installation/binaries/#giving-non-root-access) |
|
| 13 |
+> **Note**: **If you don't like sudo** then see [*Giving non-root |
|
| 14 |
+> access*](/installation/binaries/#giving-non-root-access) |
|
| 16 | 15 |
|
| 17 | 16 |
Traditionally a Docker container runs a single process when it is |
| 18 | 17 |
launched, for example an Apache daemon or a SSH server daemon. Often |
| ... | ... |
@@ -10,11 +10,10 @@ parent = "smn_applied" |
| 10 | 10 |
|
| 11 | 11 |
# Dockerizing an apt-cacher-ng service |
| 12 | 12 |
|
| 13 |
-> **Note**: |
|
| 14 |
-> - **If you don't like sudo** then see [*Giving non-root |
|
| 15 |
-> access*](/installation/binaries/#giving-non-root-access). |
|
| 16 |
-> - **If you're using OS X or docker via TCP** then you shouldn't use |
|
| 17 |
-> sudo. |
|
| 13 |
+> **Note**: **If you don't like sudo** then see [*Giving non-root |
|
| 14 |
+> access*](/installation/binaries/#giving-non-root-access). |
|
| 15 |
+> **If you're using OS X or Docker via TCP** then you shouldn't use |
|
| 16 |
+> sudo. |
|
| 18 | 17 |
|
| 19 | 18 |
When you have multiple Docker servers, or build unrelated Docker |
| 20 | 19 |
containers which can't make use of the Docker build cache, it can be |
| ... | ... |
@@ -10,9 +10,8 @@ parent = "smn_applied" |
| 10 | 10 |
|
| 11 | 11 |
# Dockerizing a CouchDB service |
| 12 | 12 |
|
| 13 |
-> **Note**: |
|
| 14 |
-> - **If you don't like sudo** then see [*Giving non-root |
|
| 15 |
-> access*](/installation/binaries/#giving-non-root-access) |
|
| 13 |
+> **Note**: **If you don't like sudo** then see [*Giving non-root |
|
| 14 |
+> access*](/installation/binaries/#giving-non-root-access) |
|
| 16 | 15 |
|
| 17 | 16 |
Here's an example of using data volumes to share the same data between |
| 18 | 17 |
two CouchDB containers. This could be used for hot upgrades, testing |
| ... | ... |
@@ -16,9 +16,7 @@ In this example, we are going to learn how to build a Docker image with |
| 16 | 16 |
MongoDB pre-installed. We'll also see how to `push` that image to the |
| 17 | 17 |
[Docker Hub registry](https://hub.docker.com) and share it with others! |
| 18 | 18 |
|
| 19 |
-> **Note:** |
|
| 20 |
-> |
|
| 21 |
-> This guide will show the mechanics of building a MongoDB container, but |
|
| 19 |
+> **Note:** This guide will show the mechanics of building a MongoDB container, but |
|
| 22 | 20 |
> you will probably want to use the official image on [Docker Hub]( https://registry.hub.docker.com/_/mongo/) |
| 23 | 21 |
|
| 24 | 22 |
Using Docker and containers for deploying [MongoDB](https://www.mongodb.org/) |
| ... | ... |
@@ -148,7 +146,7 @@ as daemon process(es). |
| 148 | 148 |
|
| 149 | 149 |
# Dockerized MongoDB, lean and mean! |
| 150 | 150 |
# Usage: docker run --name <name for container> -d <user-name>/<repository> --noprealloc --smallfiles |
| 151 |
- $ docker run -p 27017:27017 --name mongo_instance_001 -d my/repo --noprealloc --smallfiles |
|
| 151 |
+ $ docker run -p 27017:27017 --name mongo_instance_001 -d my/repo --smallfiles |
|
| 152 | 152 |
|
| 153 | 153 |
# Checking out the logs of a MongoDB container |
| 154 | 154 |
# Usage: docker logs <name for container> |
| ... | ... |
@@ -10,14 +10,11 @@ parent = "smn_applied" |
| 10 | 10 |
|
| 11 | 11 |
# Dockerizing a Node.js web app |
| 12 | 12 |
|
| 13 |
-> **Note**: |
|
| 14 |
-> - **If you don't like sudo** then see [*Giving non-root |
|
| 15 |
-> access*](/installation/binaries/#giving-non-root-access) |
|
| 16 |
- |
|
| 17 |
-The goal of this example is to show you how you can build your own |
|
| 18 |
-Docker images from a parent image using a `Dockerfile` |
|
| 19 |
-. We will do that by making a simple Node.js hello world web |
|
| 20 |
-application running on CentOS. You can get the full source code at |
|
| 13 |
+> **Note**: **If you don't like sudo** then see [*Giving non-root |
|
| 14 |
+> access*](/installation/binaries/#giving-non-root-access) |
|
| 15 |
+ |
|
| 16 |
+In this example, we are going to learn how to build a Docker image to run a |
|
| 17 |
+simple Node.js "hello world" web application on CentOS. You can get the full source code at |
|
| 21 | 18 |
[https://github.com/enokd/docker-node-hello/](https://github.com/enokd/docker-node-hello/). |
| 22 | 19 |
|
| 23 | 20 |
## Create Node.js app |
| ... | ... |
@@ -75,16 +72,16 @@ available on the [Docker Hub](https://hub.docker.com/): |
| 75 | 75 |
|
| 76 | 76 |
Since we're building a Node.js app, you'll have to install Node.js as |
| 77 | 77 |
well as npm on your CentOS image. Node.js is required to run your app |
| 78 |
-and npm to install your app's dependencies defined in |
|
| 78 |
+and npm is required to install your app's dependencies defined in |
|
| 79 | 79 |
`package.json`. To install the right package for |
| 80 | 80 |
CentOS, we'll use the instructions from the [Node.js wiki]( |
| 81 | 81 |
https://github.com/joyent/node/wiki/Installing-Node.js- |
| 82 | 82 |
via-package-manager#rhelcentosscientific-linux-6): |
| 83 | 83 |
|
| 84 |
- # Enable EPEL for Node.js |
|
| 85 |
- RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm |
|
| 84 |
+ # Enable Extra Packages for Enterprise Linux (EPEL) for CentOS |
|
| 85 |
+ RUN yum install -y epel-release |
|
| 86 | 86 |
# Install Node.js and npm |
| 87 |
- RUN yum install -y npm |
|
| 87 |
+ RUN yum install -y nodejs npm |
|
| 88 | 88 |
|
| 89 | 89 |
To bundle your app's source code inside the Docker image, use the `COPY` |
| 90 | 90 |
instruction: |
| ... | ... |
@@ -97,7 +94,7 @@ Install your app dependencies using the `npm` binary: |
| 97 | 97 |
# Install app dependencies |
| 98 | 98 |
RUN cd /src; npm install |
| 99 | 99 |
|
| 100 |
-Your app binds to port `8080` so you'll use the` EXPOSE` instruction to have |
|
| 100 |
+Your app binds to port `8080` so you'll use the `EXPOSE` instruction to have |
|
| 101 | 101 |
it mapped by the `docker` daemon: |
| 102 | 102 |
|
| 103 | 103 |
EXPOSE 8080 |
| ... | ... |
@@ -112,10 +109,10 @@ Your `Dockerfile` should now look like this: |
| 112 | 112 |
|
| 113 | 113 |
FROM centos:centos6 |
| 114 | 114 |
|
| 115 |
- # Enable EPEL for Node.js |
|
| 116 |
- RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm |
|
| 115 |
+ # Enable Extra Packages for Enterprise Linux (EPEL) for CentOS |
|
| 116 |
+ RUN yum install -y epel-release |
|
| 117 | 117 |
# Install Node.js and npm |
| 118 |
- RUN yum install -y npm |
|
| 118 |
+ RUN yum install -y nodejs npm |
|
| 119 | 119 |
|
| 120 | 120 |
# Bundle app source |
| 121 | 121 |
COPY . /src |
| ... | ... |
@@ -10,9 +10,8 @@ parent = "smn_applied" |
| 10 | 10 |
|
| 11 | 11 |
# Dockerizing PostgreSQL |
| 12 | 12 |
|
| 13 |
-> **Note**: |
|
| 14 |
-> - **If you don't like sudo** then see [*Giving non-root |
|
| 15 |
-> access*](/installation/binaries/#giving-non-root-access) |
|
| 13 |
+> **Note**: **If you don't like sudo** then see [*Giving non-root |
|
| 14 |
+> access*](/installation/binaries/#giving-non-root-access) |
|
| 16 | 15 |
|
| 17 | 16 |
## Installing PostgreSQL on Docker |
| 18 | 17 |
|
| ... | ... |
@@ -21,7 +20,7 @@ Hub](http://hub.docker.com), you can create one yourself. |
| 21 | 21 |
|
| 22 | 22 |
Start by creating a new `Dockerfile`: |
| 23 | 23 |
|
| 24 |
-> **Note**: |
|
| 24 |
+> **Note**: |
|
| 25 | 25 |
> This PostgreSQL setup is for development-only purposes. Refer to the |
| 26 | 26 |
> PostgreSQL documentation to fine-tune these settings so that it is |
| 27 | 27 |
> suitably secure. |
| ... | ... |
@@ -61,7 +60,7 @@ Start by creating a new `Dockerfile`: |
| 61 | 61 |
createdb -O docker docker |
| 62 | 62 |
|
| 63 | 63 |
# Adjust PostgreSQL configuration so that remote connections to the |
| 64 |
- # database are possible. |
|
| 64 |
+ # database are possible. |
|
| 65 | 65 |
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf |
| 66 | 66 |
|
| 67 | 67 |
# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf`` |
| ... | ... |
@@ -88,7 +87,7 @@ There are 2 ways to connect to the PostgreSQL server. We can use [*Link |
| 88 | 88 |
Containers*](/userguide/dockerlinks), or we can access it from our host |
| 89 | 89 |
(or the network). |
| 90 | 90 |
|
| 91 |
-> **Note**: |
|
| 91 |
+> **Note**: |
|
| 92 | 92 |
> The `--rm` removes the container and its image when |
| 93 | 93 |
> the container exits successfully. |
| 94 | 94 |
|