From 6861223d5bd96e1f4165eeaf937f2f465fe34de9 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 7 Jul 2014 12:06:34 -0600 Subject: Standardize "apt-get install" usage across the repo I might have missed some, but I think this is most of the offenders. Docker-DCO-1.1-Signed-off-by: Andrew Page (github: tianon) (cherry picked from commit fc637b5275c2fe23c9857a34316a783042d906b8) Conflicts: docs/sources/examples/running_riak_service.md Docker-DCO-1.1-Signed-off-by: Tianon Gravi (github: SvenDowideit) --- docs/sources/examples/apt-cacher-ng.Dockerfile | 4 ++-- docs/sources/examples/apt-cacher-ng.md | 6 +++--- docs/sources/examples/mongodb.md | 5 ++--- docs/sources/examples/mongodb/Dockerfile | 7 +++---- docs/sources/examples/postgresql_service.Dockerfile | 8 ++------ docs/sources/examples/postgresql_service.md | 8 ++------ docs/sources/examples/running_redis_service.md | 9 ++++----- docs/sources/examples/running_riak_service.md | 20 ++------------------ docs/sources/examples/running_ssh_service.Dockerfile | 5 +---- docs/sources/examples/running_ssh_service.md | 5 +---- 10 files changed, 22 insertions(+), 55 deletions(-) (limited to 'docs/sources/examples') 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/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..edcd63bbbc 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 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 -- cgit v1.2.1 From f2d94241a788592d8077b5e7c813d1fb599403cf Mon Sep 17 00:00:00 2001 From: Jan Toebes Date: Mon, 28 Jul 2014 20:43:24 +0200 Subject: Update nodejs_web_app.md The image centos:centos6.4 doesn't exist. Instead you have to choose between the official centos6 or centos7. Both images does not work together with de yum npm install. When choosing an centos6.5 from another distributor (tutum) it works. (cherry picked from commit 2519872d77da8cb6a9c5f55e44cfaeb9cd603978) Docker-DCO-1.1-Signed-off-by: Jan Toebes (github: SvenDowideit) --- docs/sources/examples/nodejs_web_app.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/sources/examples') diff --git a/docs/sources/examples/nodejs_web_app.md b/docs/sources/examples/nodejs_web_app.md index 03c48b5175..840d85e12e 100644 --- a/docs/sources/examples/nodejs_web_app.md +++ b/docs/sources/examples/nodejs_web_app.md @@ -69,7 +69,7 @@ top of. Here, we'll use [CentOS](https://registry.hub.docker.com/_/centos/) (tag: `6.4`) available on the [Docker Hub](https://hub.docker.com/): - FROM centos:6.4 + FROM tutum/centos-6.4 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 tutum/centos-6.4 # 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 - /centos-node-hello latest d64d3505b0d2 2 hours ago + REPOSITORY TAG ID CREATED + tutum centos-6.4 539c0211cd76 8 weeks ago + /centos-node-hello latest d64d3505b0d2 2 hours ago ## Run the image -- cgit v1.2.1 From 985f14876cc1fc4336856e3889a9c1bd9612eee9 Mon Sep 17 00:00:00 2001 From: Jan Toebes Date: Thu, 31 Jul 2014 08:54:22 +0200 Subject: Update nodejs_web_app.md Updated to documentation to use the centos6 image instead of the unofficial tutum image of centos6.4 (cherry picked from commit bfacdfdccf5e93301842309a0048990ef0ebb549) Docker-DCO-1.1-Signed-off-by: Jan Toebes (github: SvenDowideit) --- docs/sources/examples/nodejs_web_app.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/sources/examples') diff --git a/docs/sources/examples/nodejs_web_app.md b/docs/sources/examples/nodejs_web_app.md index 840d85e12e..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 tutum/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 tutum/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 - tutum centos-6.4 539c0211cd76 8 weeks ago - /centos-node-hello latest d64d3505b0d2 2 hours ago + REPOSITORY TAG ID CREATED + centos centos6 539c0211cd76 8 weeks ago + /centos-node-hello latest d64d3505b0d2 2 hours ago ## Run the image -- cgit v1.2.1 From 553002f5cef5ea93ab5bdfb49df53fc49d54085b Mon Sep 17 00:00:00 2001 From: Michael Thies Date: Tue, 12 Aug 2014 23:30:04 -0500 Subject: Update postgresql_service.md fix typo (cherry picked from commit 99423e7e1ef7d833e333389b15a372179734c03f) Docker-DCO-1.1-Signed-off-by: Michael Thies (github: SvenDowideit) --- docs/sources/examples/postgresql_service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/sources/examples') diff --git a/docs/sources/examples/postgresql_service.md b/docs/sources/examples/postgresql_service.md index edcd63bbbc..ffd122ed58 100644 --- a/docs/sources/examples/postgresql_service.md +++ b/docs/sources/examples/postgresql_service.md @@ -84,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 -- cgit v1.2.1