diff --git a/gcc/README-content.md b/gcc/README-content.md index 2bfe79e7..c953b7a5 100644 --- a/gcc/README-content.md +++ b/gcc/README-content.md @@ -9,7 +9,7 @@ The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Proje For this image, the most straight-forward use is to use a gcc container as both the build environment as well as the runtime environment. In your Dockerfile, you can do something along the lines of the following will compile and run your project. - FROM gcc + FROM gcc:4.9 ADD . /usr/src/myapp WORKDIR /usr/src/myapp RUN gcc -o myapp main.c @@ -24,8 +24,8 @@ Then run the commands to build and run the docker image. It is not always appropriate to run your app inside a container. In instances where you only want to compile inside the docker instance, you can do something along the lines of the following. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc gcc -o myapp myapp.c + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc:4.9 gcc -o myapp myapp.c -This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `gcc -o myapp myapp.c` which will tell gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. +This will add your current directory as a volume to the container, set the working directory to the volume, and run the command `gcc -o myapp myapp.c` which will tell gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc make + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc:4.9 make diff --git a/gcc/README.md b/gcc/README.md index 407ae102..6baf6abb 100644 --- a/gcc/README.md +++ b/gcc/README.md @@ -9,7 +9,7 @@ The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Proje For this image, the most straight-forward use is to use a gcc container as both the build environment as well as the runtime environment. In your Dockerfile, you can do something along the lines of the following will compile and run your project. - FROM gcc + FROM gcc:4.9 ADD . /usr/src/myapp WORKDIR /usr/src/myapp RUN gcc -o myapp main.c @@ -24,11 +24,11 @@ Then run the commands to build and run the docker image. It is not always appropriate to run your app inside a container. In instances where you only want to compile inside the docker instance, you can do something along the lines of the following. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc gcc -o myapp myapp.c + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc:4.9 gcc -o myapp myapp.c -This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `gcc -o myapp myapp.c` which will tell gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. +This will add your current directory as a volume to the container, set the working directory to the volume, and run the command `gcc -o myapp myapp.c` which will tell gcc to compile the code in myapp.c and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc make + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc:4.9 make # User Feedback diff --git a/golang/README-content.md b/golang/README-content.md index c0d3e8e0..74931c41 100644 --- a/golang/README-content.md +++ b/golang/README-content.md @@ -9,12 +9,11 @@ Go, also called golang, is a programming language initially developed at Google For this image, the most straight-forward use is to use a golang container as both the build environment as well as the runtime environment. In your Dockerfile, you can do something along the lines of the following will compile and run your project. - FROM golang - ADD . /usr/src/myapp - WORKDIR /usr/src/myapp - RUN go build + FROM golang:1.3-onbuild CMD ["./myapp"] +This image includes multiple `ONBUILD` triggers so that should be all that you need for most applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v`, and `RUN go build -v`. + Then run and build the docker image. docker build -t my-golang-app @@ -24,8 +23,8 @@ Then run and build the docker image. It is not always appropriate to run your app inside a container. In instances where you only want to compile inside the docker instance, you can do something along the lines of the following. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang go build + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3 go build -v -This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `go build` which will tell go to compile the project in the working directory and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. +This will add your current directory as a volume to the container, set the working directory to the volume, and run the command `go build` which will tell go to compile the project in the working directory and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp make + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3 make diff --git a/golang/README.md b/golang/README.md index fb36d7d1..0f68f804 100644 --- a/golang/README.md +++ b/golang/README.md @@ -9,12 +9,11 @@ Go, also called golang, is a programming language initially developed at Google For this image, the most straight-forward use is to use a golang container as both the build environment as well as the runtime environment. In your Dockerfile, you can do something along the lines of the following will compile and run your project. - FROM golang - ADD . /usr/src/myapp - WORKDIR /usr/src/myapp - RUN go build + FROM golang:1.3-onbuild CMD ["./myapp"] +This image includes multiple `ONBUILD` triggers so that should be all that you need for most applications. The build will `COPY . /usr/src/app`, `RUN go get -d -v`, and `RUN go build -v`. + Then run and build the docker image. docker build -t my-golang-app @@ -24,11 +23,11 @@ Then run and build the docker image. It is not always appropriate to run your app inside a container. In instances where you only want to compile inside the docker instance, you can do something along the lines of the following. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang go build + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3 go build -v -This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `go build` which will tell go to compile the project in the working directory and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. +This will add your current directory as a volume to the container, set the working directory to the volume, and run the command `go build` which will tell go to compile the project in the working directory and output the executable to myapp. Alternatively, if you have a make file, you can instead run the make command inside your container. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp make + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3 make # User Feedback diff --git a/java/README-content.md b/java/README-content.md index 285b5e78..2a2f8d51 100644 --- a/java/README-content.md +++ b/java/README-content.md @@ -1,4 +1,4 @@ -Java is a concurrent, class-based, object-oriented language specifically designed to have as few implementation dependencies as possible. It is inteneded to allow application developers to "write once, run anywhere", meaning that code that runs on one platform does not need to be recompiled to run on another. +Java is a concurrent, class-based, object-oriented language specifically designed to have as few implementation dependencies as possible. It is intended to allow application developers to "write once, run anywhere", meaning that code that runs on one platform does not need to be recompiled to run on another. Java is a registered trademark of Oracle and/or its affiliates. @@ -10,7 +10,7 @@ Java is a registered trademark of Oracle and/or its affiliates. For this image, the most straight-forward use is to use a java container as both the build environment as well as the runtime environment. In your Dockerfile, you can do something along the lines of the following will compile and run your project. - FROM java + FROM java:7 ADD . /usr/src/myapp WORKDIR /usr/src/myapp RUN javac Main.java @@ -25,8 +25,8 @@ Then run the commands to build and run the docker image. It is not always appropriate to run your app inside a container. In instances where you only want to compile inside the docker instance, you can do something along the lines of the following. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java javac Main.java + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java:7 javac Main.java -This will add your current directory as a volume to the comtainer, set the working directory to the volume, and run the command `javac Main.java` which will tell java to compile the code in Main.java and output the java class file to Main.class. Alternatively, if you have a make file, you can instead run the make command inside your container. +This will add your current directory as a volume to the container, set the working directory to the volume, and run the command `javac Main.java` which will tell java to compile the code in Main.java and output the java class file to Main.class. Alternatively, if you have a make file, you can instead run the make command inside your container. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java make + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java:7 make diff --git a/java/README.md b/java/README.md index 20bad4bd..7a5e206f 100644 --- a/java/README.md +++ b/java/README.md @@ -25,11 +25,11 @@ Then run the commands to build and run the docker image. It is not always appropriate to run your app inside a container. In instances where you only want to compile inside the docker instance, you can do something along the lines of the following. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java javac Main.java + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java:7 javac Main.java This will add your current directory as a volume to the container, set the working directory to the volume, and run the command `javac Main.java` which will tell java to compile the code in Main.java and output the java class file to Main.class. Alternatively, if you have a make file, you can instead run the make command inside your container. - docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java make + docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java:7 make # User Feedback diff --git a/node/README-content.md b/node/README-content.md index dd7d507c..de78dc5c 100644 --- a/node/README-content.md +++ b/node/README-content.md @@ -9,16 +9,21 @@ Node.js internally uses the Google V8 JavaScript engine to execute code, and a l # How to use this image - FROM node - - ADD . /usr/src/app - WORKDIR /usr/src/app - - # install your application's dependencies - RUN npm install +## Create a `Dockerfile` in your nodejs app project. + FROM node:0.10.31-onbuild # replace this with your application's default port EXPOSE 8888 - # replace this with your main "server" script file CMD [ "node", "server.js" ] + +Then build and run the docker image. + + docker build -t my-nodejs-app + docker run -it --rm --name my-running-app my-nodejs-app + +## Run a single nodejs script + +For many single file projects, it may not be convenient to write a `Dockerfile` for your project. In such cases, you can run a nodejs script by using the nodejs docker image directly. + + docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp node:0.10.31 node your-daemon-or-script.rb diff --git a/node/README.md b/node/README.md index 68ccd0fd..ee8cac5b 100644 --- a/node/README.md +++ b/node/README.md @@ -9,20 +9,25 @@ Node.js internally uses the Google V8 JavaScript engine to execute code, and a l # How to use this image - FROM node - - ADD . /usr/src/app - WORKDIR /usr/src/app - - # install your application's dependencies - RUN npm install +## Create a `Dockerfile` in your nodejs app project. + FROM node:0.10.31-onbuild # replace this with your application's default port EXPOSE 8888 - # replace this with your main "server" script file CMD [ "node", "server.js" ] +Then build and run the docker image. + + docker build -t my-nodejs-app + docker run -it --rm --name my-running-app my-nodejs-app + +## Run a single nodejs script + +For many single file projects, it may not be convenient to write a `Dockerfile` for your project. In such cases, you can run a nodejs script by using the nodejs docker image directly. + + docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp node:0.10.31 node your-daemon-or-script.rb + # User Feedback ## Issues diff --git a/perl/README-content.md b/perl/README-content.md index 9be2dd9e..9ae6a024 100644 --- a/perl/README-content.md +++ b/perl/README-content.md @@ -7,7 +7,7 @@ Perl is a family of high-level, general-purpose, interpreted, dynamic programmin ## Create a `Dockerfile` in your perl app project. - FROM perl + FROM perl:5.20 ADD . /usr/src/myapp WORKDIR /usr/src/myapp CMD [ "perl", "./your-daemon-or-script.pl" ] @@ -21,4 +21,4 @@ Then build and run the docker image. For many single file projects, it may not be convenient to write a `Dockerfile` for your project. In such cases, you can run a perl script by using the perl docker image directly. - docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp perl perl your-daemon-or-script.pl + docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp perl:5.20 perl your-daemon-or-script.pl diff --git a/perl/README.md b/perl/README.md index b2b57676..04569826 100644 --- a/perl/README.md +++ b/perl/README.md @@ -7,7 +7,7 @@ Perl is a family of high-level, general-purpose, interpreted, dynamic programmin ## Create a `Dockerfile` in your perl app project. - FROM perl + FROM perl:5.20 ADD . /usr/src/myapp WORKDIR /usr/src/myapp CMD [ "perl", "./your-daemon-or-script.pl" ] @@ -21,7 +21,7 @@ Then build and run the docker image. For many single file projects, it may not be convenient to write a `Dockerfile` for your project. In such cases, you can run a perl script by using the perl docker image directly. - docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp perl perl your-daemon-or-script.pl + docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp perl:5.20 perl your-daemon-or-script.pl # User Feedback diff --git a/rails/README-content.md b/rails/README-content.md index cdd65433..e0bd7fd0 100644 --- a/rails/README-content.md +++ b/rails/README-content.md @@ -6,23 +6,19 @@ Ruby on Rails, often simply referred to as Rails, is an open source web applicat # How to use this image -## 1. create a `Dockerfile` in your rails app project - +## Create a `Dockerfile` in your rails app project FROM rails:onbuild Put this file in the root of your app, next to the `Gemfile`. -This image includes multiple `ONBUILD` triggers so that should be all that you need for most applications. The build will `ADD . /usr/src/app`, `RUN bundle install`, `EXPOSE 3000`, and set the default command to `rails server`. +This image includes multiple `ONBUILD` triggers so that should be all that you need for most applications. The build will `ADD . /usr/src/app`, `RUN bundle install`, `EXPOSE 3000`, and set the default command to `rails server`. -## 2. build the rails app image +Then build and run the docker image. docker build -t my-rails-app . - -## 3. start the rails app container - docker run --name some-rails-app -d my-rails-app -Then hit `http://container-ip:3000` in a browser. On the other hand, if you need access outside the host on port 8080: +Test it by visiting `http://container-ip:3000` in a browser. On the other hand, if you need access outside the host on port 8080: docker run --name some-rails-app -p 8080:3000 -d my-rails-app diff --git a/rails/README.md b/rails/README.md index 52074cf5..2d33b68f 100644 --- a/rails/README.md +++ b/rails/README.md @@ -6,23 +6,19 @@ Ruby on Rails, often simply referred to as Rails, is an open source web applicat # How to use this image -## 1. create a `Dockerfile` in your rails app project - +## Create a `Dockerfile` in your rails app project FROM rails:onbuild Put this file in the root of your app, next to the `Gemfile`. -This image includes multiple `ONBUILD` triggers so that should be all that you need for most applications. The build will `ADD . /usr/src/app`, `RUN bundle install`, `EXPOSE 3000`, and set the default command to `rails server`. +This image includes multiple `ONBUILD` triggers so that should be all that you need for most applications. The build will `ADD . /usr/src/app`, `RUN bundle install`, `EXPOSE 3000`, and set the default command to `rails server`. -## 2. build the rails app image +Then build and run the docker image. docker build -t my-rails-app . - -## 3. start the rails app container - docker run --name some-rails-app -d my-rails-app -Then hit `http://container-ip:3000` in a browser. On the other hand, if you need access outside the host on port 8080: +Test it by visiting `http://container-ip:3000` in a browser. On the other hand, if you need access outside the host on port 8080: docker run --name some-rails-app -p 8080:3000 -d my-rails-app diff --git a/ruby/README-content.md b/ruby/README-content.md index a9364bf5..3a9e9d3b 100644 --- a/ruby/README-content.md +++ b/ruby/README-content.md @@ -9,7 +9,7 @@ According to its authors, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, a ## Create a `Dockerfile` in your ruby app project - FROM ruby:onbuild + FROM ruby:2.1.2-onbuild CMD ["./your-daemon-or-script.rb"] Put this file in the root of your app, next to the `Gemfile`. @@ -25,4 +25,4 @@ Then build and run the ruby image. For many single file projects, it may not be convenient to write a `Dockerfile` for your project. In such cases, you can run a ruby script by using the ruby docker image directly. - docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp ruby ruby your-daemon-or-script.rb + docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp ruby:2.1.2 ruby your-daemon-or-script.rb diff --git a/ruby/README.md b/ruby/README.md index 727216e5..5afb0cec 100644 --- a/ruby/README.md +++ b/ruby/README.md @@ -9,7 +9,7 @@ According to its authors, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, a ## Create a `Dockerfile` in your ruby app project - FROM ruby:onbuild + FROM ruby:2.1.2-onbuild CMD ["./your-daemon-or-script.rb"] Put this file in the root of your app, next to the `Gemfile`. @@ -25,7 +25,7 @@ Then build and run the ruby image. For many single file projects, it may not be convenient to write a `Dockerfile` for your project. In such cases, you can run a ruby script by using the ruby docker image directly. - docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp ruby ruby your-daemon-or-script.rb + docker run -it --rm --name my-running-script -v $(pwd):/usr/src/myapp -w /usr/src/myapp ruby:2.1.2 ruby your-daemon-or-script.rb # User Feedback