summaryrefslogtreecommitdiff
path: root/docs/sources/examples
diff options
context:
space:
mode:
Diffstat (limited to 'docs/sources/examples')
-rw-r--r--docs/sources/examples/apt-cacher-ng.Dockerfile4
-rw-r--r--docs/sources/examples/apt-cacher-ng.md6
-rw-r--r--docs/sources/examples/mongodb.md5
-rw-r--r--docs/sources/examples/mongodb/Dockerfile7
-rw-r--r--docs/sources/examples/nodejs_web_app.md12
-rw-r--r--docs/sources/examples/postgresql_service.Dockerfile8
-rw-r--r--docs/sources/examples/postgresql_service.md10
-rw-r--r--docs/sources/examples/running_redis_service.md9
-rw-r--r--docs/sources/examples/running_riak_service.md20
-rw-r--r--docs/sources/examples/running_ssh_service.Dockerfile5
-rw-r--r--docs/sources/examples/running_ssh_service.md5
11 files changed, 29 insertions, 62 deletions
diff --git a/docs/sources/examples/apt-cacher-ng.Dockerfile b/docs/sources/examples/apt-cacher-ng.Dockerfile
index 3b7862bb58..d1f76572b9 100644
--- a/docs/sources/examples/apt-cacher-ng.Dockerfile
+++ b/docs/sources/examples/apt-cacher-ng.Dockerfile
@@ -9,7 +9,7 @@ FROM ubuntu
MAINTAINER SvenDowideit@docker.com
VOLUME ["/var/cache/apt-cacher-ng"]
-RUN apt-get update ; apt-get install -yq apt-cacher-ng
+RUN apt-get update && apt-get install -y apt-cacher-ng
EXPOSE 3142
-CMD chmod 777 /var/cache/apt-cacher-ng ; /etc/init.d/apt-cacher-ng start ; tail -f /var/log/apt-cacher-ng/*
+CMD chmod 777 /var/cache/apt-cacher-ng && /etc/init.d/apt-cacher-ng start && tail -f /var/log/apt-cacher-ng/*
diff --git a/docs/sources/examples/apt-cacher-ng.md b/docs/sources/examples/apt-cacher-ng.md
index 34e4a4bf02..7dafec1593 100644
--- a/docs/sources/examples/apt-cacher-ng.md
+++ b/docs/sources/examples/apt-cacher-ng.md
@@ -28,10 +28,10 @@ Use the following Dockerfile:
MAINTAINER SvenDowideit@docker.com
VOLUME ["/var/cache/apt-cacher-ng"]
- RUN apt-get update ; apt-get install -yq apt-cacher-ng
+ RUN apt-get update && apt-get install -y apt-cacher-ng
EXPOSE 3142
- CMD chmod 777 /var/cache/apt-cacher-ng ; /etc/init.d/apt-cacher-ng start ; tail -f /var/log/apt-cacher-ng/*
+ CMD chmod 777 /var/cache/apt-cacher-ng && /etc/init.d/apt-cacher-ng start && tail -f /var/log/apt-cacher-ng/*
To build the image using:
@@ -61,7 +61,7 @@ a local version of a common base:
FROM ubuntu
RUN echo 'Acquire::http { Proxy "http://dockerhost:3142"; };' >> /etc/apt/apt.conf.d/01proxy
- RUN apt-get update ; apt-get install vim git
+ RUN apt-get update && apt-get install -y vim git
# docker build -t my_ubuntu .
diff --git a/docs/sources/examples/mongodb.md b/docs/sources/examples/mongodb.md
index 602f55ca88..28f7824594 100644
--- a/docs/sources/examples/mongodb.md
+++ b/docs/sources/examples/mongodb.md
@@ -65,13 +65,12 @@ a MongoDB repository file for the package manager.
After this initial preparation we can update our packages and install MongoDB.
# Update apt-get sources AND install MongoDB
- RUN apt-get update
- RUN apt-get install -y -q mongodb-org
+ RUN apt-get update && apt-get install -y mongodb-org
> **Tip:** You can install a specific version of MongoDB by using a list
> of required packages with versions, e.g.:
>
-> RUN apt-get install -y -q mongodb-org=2.6.1 mongodb-org-server=2.6.1 mongodb-org-shell=2.6.1 mongodb-org-mongos=2.6.1 mongodb-org-tools=2.6.1
+> RUN apt-get update && apt-get install -y mongodb-org=2.6.1 mongodb-org-server=2.6.1 mongodb-org-shell=2.6.1 mongodb-org-mongos=2.6.1 mongodb-org-tools=2.6.1
MongoDB requires a data directory. Let's create it as the final step of our
installation instructions.
diff --git a/docs/sources/examples/mongodb/Dockerfile b/docs/sources/examples/mongodb/Dockerfile
index e7acc0fd85..9333eb5811 100644
--- a/docs/sources/examples/mongodb/Dockerfile
+++ b/docs/sources/examples/mongodb/Dockerfile
@@ -11,8 +11,7 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list
# Update apt-get sources AND install MongoDB
-RUN apt-get update
-RUN apt-get install -y -q mongodb-org
+RUN apt-get update && apt-get install -y mongodb-org
# Create the MongoDB data directory
RUN mkdir -p /data/db
@@ -20,5 +19,5 @@ RUN mkdir -p /data/db
# Expose port #27017 from the container to the host
EXPOSE 27017
-# Set usr/bin/mongod as the dockerized entry-point application
-ENTRYPOINT usr/bin/mongod
+# Set /usr/bin/mongod as the dockerized entry-point application
+ENTRYPOINT ["/usr/bin/mongod"]
diff --git a/docs/sources/examples/nodejs_web_app.md b/docs/sources/examples/nodejs_web_app.md
index 03c48b5175..5d69fd713b 100644
--- a/docs/sources/examples/nodejs_web_app.md
+++ b/docs/sources/examples/nodejs_web_app.md
@@ -66,10 +66,10 @@ requires to build (this example uses Docker 0.3.4):
Next, define the parent image you want to use to build your own image on
top of. Here, we'll use
-[CentOS](https://registry.hub.docker.com/_/centos/) (tag: `6.4`)
+[CentOS](https://registry.hub.docker.com/_/centos/) (tag: `centos6`)
available on the [Docker Hub](https://hub.docker.com/):
- FROM centos:6.4
+ FROM centos:centos6
Since we're building a Node.js app, you'll have to install Node.js as
well as npm on your CentOS image. Node.js is required to run your app
@@ -109,7 +109,7 @@ defines your runtime, i.e. `node`, and the path to our app, i.e. `src/index.js`
Your `Dockerfile` should now look like this:
# DOCKER-VERSION 0.3.4
- FROM centos:6.4
+ FROM centos:centos6
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
@@ -137,9 +137,9 @@ Your image will now be listed by Docker:
$ sudo docker images
# Example
- REPOSITORY TAG ID CREATED
- centos 6.4 539c0211cd76 8 weeks ago
- <your username>/centos-node-hello latest d64d3505b0d2 2 hours ago
+ REPOSITORY TAG ID CREATED
+ centos centos6 539c0211cd76 8 weeks ago
+ <your username>/centos-node-hello latest d64d3505b0d2 2 hours ago
## Run the image
diff --git a/docs/sources/examples/postgresql_service.Dockerfile b/docs/sources/examples/postgresql_service.Dockerfile
index 364a18a81d..d0f37669d1 100644
--- a/docs/sources/examples/postgresql_service.Dockerfile
+++ b/docs/sources/examples/postgresql_service.Dockerfile
@@ -13,17 +13,13 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B97B0AFCAA
# of PostgreSQL, ``9.3``.
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
-# Update the Ubuntu and PostgreSQL repository indexes
-RUN apt-get update
-
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
# There are some warnings (in red) that show up during the build. You can hide
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
-RUN apt-get -y -q install python-software-properties software-properties-common
-RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
+RUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
-# after each ``apt-get``
+# after each ``apt-get``
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
USER postgres
diff --git a/docs/sources/examples/postgresql_service.md b/docs/sources/examples/postgresql_service.md
index 5265935e3d..ffd122ed58 100644
--- a/docs/sources/examples/postgresql_service.md
+++ b/docs/sources/examples/postgresql_service.md
@@ -35,17 +35,13 @@ Start by creating a new `Dockerfile`:
# of PostgreSQL, ``9.3``.
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
- # Update the Ubuntu and PostgreSQL repository indexes
- RUN apt-get update
-
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
# There are some warnings (in red) that show up during the build. You can hide
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
- RUN apt-get -y -q install python-software-properties software-properties-common
- RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
+ RUN apt-get update && apt-get install -y python-software-properties software-properties-common postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
- # after each ``apt-get``
+ # after each ``apt-get``
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
USER postgres
@@ -88,7 +84,7 @@ Containers*](/userguide/dockerlinks), or we can access it from our host
> **Note**:
> The `--rm` removes the container and its image when
-> the container exists successfully.
+> the container exits successfully.
### Using container linking
diff --git a/docs/sources/examples/running_redis_service.md b/docs/sources/examples/running_redis_service.md
index 0eeef0625d..6d052da09e 100644
--- a/docs/sources/examples/running_redis_service.md
+++ b/docs/sources/examples/running_redis_service.md
@@ -13,8 +13,7 @@ Firstly, we create a `Dockerfile` for our new Redis
image.
FROM ubuntu:12.10
- RUN apt-get update
- RUN apt-get -y install redis-server
+ RUN apt-get update && apt-get install -y redis-server
EXPOSE 6379
ENTRYPOINT ["/usr/bin/redis-server"]
@@ -49,9 +48,9 @@ container to only this container.
Once inside our freshly created container we need to install Redis to
get the `redis-cli` binary to test our connection.
- $ apt-get update
- $ apt-get -y install redis-server
- $ service redis-server stop
+ $ sudo apt-get update
+ $ sudo apt-get install redis-server
+ $ sudo service redis-server stop
As we've used the `--link redis:db` option, Docker
has created some environment variables in our web application container.
diff --git a/docs/sources/examples/running_riak_service.md b/docs/sources/examples/running_riak_service.md
index d9f2c42850..c3d83bf663 100644
--- a/docs/sources/examples/running_riak_service.md
+++ b/docs/sources/examples/running_riak_service.md
@@ -25,13 +25,6 @@ of. We'll use [Ubuntu](https://registry.hub.docker.com/_/ubuntu/) (tag:
FROM ubuntu:latest
MAINTAINER Hector Castro hector@basho.com
-Next, we update the APT cache and apply any updates:
-
- # Update the APT cache
- RUN sed -i.bak 's/main$/main universe/' /etc/apt/sources.list
- RUN apt-get update
- RUN apt-get upgrade -y
-
After that, we install and setup a few dependencies:
- `curl` is used to download Basho's APT
@@ -46,7 +39,7 @@ After that, we install and setup a few dependencies:
<!-- -->
# Install and setup project dependencies
- RUN apt-get install -y curl lsb-release supervisor openssh-server
+ RUN apt-get update && apt-get install -y curl lsb-release supervisor openssh-server
RUN mkdir -p /var/run/sshd
RUN mkdir -p /var/log/supervisor
@@ -61,23 +54,14 @@ Next, we add Basho's APT repository:
RUN curl -sSL http://apt.basho.com/gpg/basho.apt.key | apt-key add --
RUN echo "deb http://apt.basho.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/basho.list
- RUN apt-get update
After that, we install Riak and alter a few defaults:
# Install Riak and prepare it to run
- RUN apt-get install -y riak
+ RUN apt-get update && apt-get install -y riak
RUN sed -i.bak 's/127.0.0.1/0.0.0.0/' /etc/riak/app.config
RUN echo "ulimit -n 4096" >> /etc/default/riak
-Almost there. Next, we add a hack to get us by the lack of
-`initctl`:
-
- # Hack for initctl
- # See: https://github.com/dotcloud/docker/issues/1024
- RUN dpkg-divert --local --rename --add /sbin/initctl
- RUN ln -s /bin/true /sbin/initctl
-
Then, we expose the Riak Protocol Buffers and HTTP interfaces, along
with SSH:
diff --git a/docs/sources/examples/running_ssh_service.Dockerfile b/docs/sources/examples/running_ssh_service.Dockerfile
index 57baf88cef..1b8ed02a8a 100644
--- a/docs/sources/examples/running_ssh_service.Dockerfile
+++ b/docs/sources/examples/running_ssh_service.Dockerfile
@@ -5,10 +5,7 @@
FROM ubuntu:12.04
MAINTAINER Thatcher R. Peskens "thatcher@dotcloud.com"
-# make sure the package repository is up to date
-RUN apt-get update
-
-RUN apt-get install -y openssh-server
+RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' |chpasswd
diff --git a/docs/sources/examples/running_ssh_service.md b/docs/sources/examples/running_ssh_service.md
index a8405e748e..7140678e3b 100644
--- a/docs/sources/examples/running_ssh_service.md
+++ b/docs/sources/examples/running_ssh_service.md
@@ -15,10 +15,7 @@ quick access to a test container.
FROM ubuntu:12.04
MAINTAINER Thatcher R. Peskens "thatcher@dotcloud.com"
- # make sure the package repository is up to date
- RUN apt-get update
-
- RUN apt-get install -y openssh-server
+ RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' |chpasswd