Replace `$(pwd)` with `$PWD`

This commit is contained in:
Stuart P. Bentley 2015-02-04 20:06:32 +00:00
parent 1785593baf
commit 561ef9619a
38 changed files with 63 additions and 63 deletions

View File

@ -67,7 +67,7 @@ You can then build and run the image as above.
If you have an existing Lein/Clojure project, it's fairly straightforward to
compile your project into a jar from a container:
docker run -it --rm -v "$(pwd)":/usr/src/app -w /usr/src/app clojure lein uberjar
docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app clojure lein uberjar
This will build your project into a jar file located in your project's
`target/uberjar` directory.

View File

@ -56,7 +56,7 @@ You can then build and run the image as above.
If you have an existing Lein/Clojure project, it's fairly straightforward to
compile your project into a jar from a container:
docker run -it --rm -v "$(pwd)":/usr/src/app -w /usr/src/app clojure lein uberjar
docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app clojure lein uberjar
This will build your project into a jar file located in your project's
`target/uberjar` directory.

View File

@ -50,14 +50,14 @@ Of course, if you don't want to take advantage of magical and convenient
`ONBUILD` triggers, you can always just use `docker run` directly to avoid
having to add a `Dockerfile` to your project.
docker run --name some-django-app -v "$(pwd)":/usr/src/app -w /usr/src/app -p 8000:8000 -d django bash -c "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:8000"
docker run --name some-django-app -v "$PWD":/usr/src/app -w /usr/src/app -p 8000:8000 -d django bash -c "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:8000"
## Bootstrap a new Django Application
If you want to generate the scaffolding for a new Django project, you can do the
following:
docker run -it --rm --user "$(id -u):$(id -g)" -v "$(pwd)":/usr/src/app -w /usr/src/app django django-admin.py startproject mysite
docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app django django-admin.py startproject mysite
This will create a sub-directory named `mysite` inside your current directory.

View File

@ -37,13 +37,13 @@ Of course, if you don't want to take advantage of magical and convenient
`ONBUILD` triggers, you can always just use `docker run` directly to avoid
having to add a `Dockerfile` to your project.
docker run --name some-django-app -v "$(pwd)":/usr/src/app -w /usr/src/app -p 8000:8000 -d django bash -c "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:8000"
docker run --name some-django-app -v "$PWD":/usr/src/app -w /usr/src/app -p 8000:8000 -d django bash -c "pip install -r requirements.txt && python manage.py runserver 0.0.0.0:8000"
## Bootstrap a new Django Application
If you want to generate the scaffolding for a new Django project, you can do the
following:
docker run -it --rm --user "$(id -u):$(id -g)" -v "$(pwd)":/usr/src/app -w /usr/src/app django django-admin.py startproject mysite
docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app django django-admin.py startproject mysite
This will create a sub-directory named `mysite` inside your current directory.

View File

@ -48,7 +48,7 @@ There may be occasions where it is not appropriate to run your app inside a
container. To compile, but not run your app inside the Docker instance, you can
write something like:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc:4.9 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 container, set the
working directory to the volume, and run the command `gcc -o myapp myapp.c.`
@ -56,7 +56,7 @@ This tells gcc to compile the code in `myapp.c` and output the executable to
myapp. Alternatively, if you have a `Makefile`, you can instead run the `make`
command inside your container:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc:4.9 make
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp gcc:4.9 make
# License

View File

@ -35,7 +35,7 @@ There may be occasions where it is not appropriate to run your app inside a
container. To compile, but not run your app inside the Docker instance, you can
write something like:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc:4.9 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 container, set the
working directory to the volume, and run the command `gcc -o myapp myapp.c.`
@ -43,4 +43,4 @@ This tells gcc to compile the code in `myapp.c` and output the executable to
myapp. Alternatively, if you have a `Makefile`, you can instead run the `make`
command inside your container:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp gcc:4.9 make
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp gcc:4.9 make

View File

@ -55,7 +55,7 @@ There may be occasions where it is not appropriate to run your app inside a
container. To compile, but not run your app inside the Docker instance, you can
write something like:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3 go build -v
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 container, set the
working directory to the volume, and run the command `go build` which will tell
@ -63,7 +63,7 @@ go to compile the project in the working directory and output the executable to
`myapp`. Alternatively, if you have a `Makefile`, you can run the `make` command
inside your container.
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3 make
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.3 make
## Cross-compile your app inside the Docker container
@ -71,11 +71,11 @@ If you need to compile your application for a platform other than `linux/amd64`
(such as `windows/386`), this can be easily accomplished with the provided
`cross` tags:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 golang:1.3-cross go build -v
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 golang:1.3-cross go build -v
Alternatively, you can build for multiple platforms at once:
docker run --rm -it -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3-cross bash
docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.3-cross bash
$ for GOOS in darwin linux; do
> for GOARCH in 386 amd64; do
> go build -v -o myapp-$GOOS-$GOARCH

View File

@ -38,7 +38,7 @@ There may be occasions where it is not appropriate to run your app inside a
container. To compile, but not run your app inside the Docker instance, you can
write something like:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3 go build -v
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 container, set the
working directory to the volume, and run the command `go build` which will tell
@ -46,7 +46,7 @@ go to compile the project in the working directory and output the executable to
`myapp`. Alternatively, if you have a `Makefile`, you can run the `make` command
inside your container.
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3 make
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.3 make
## Cross-compile your app inside the Docker container
@ -54,11 +54,11 @@ If you need to compile your application for a platform other than `linux/amd64`
(such as `windows/386`), this can be easily accomplished with the provided
`cross` tags:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 golang:1.3-cross go build -v
docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp -e GOOS=windows -e GOARCH=386 golang:1.3-cross go build -v
Alternatively, you can build for multiple platforms at once:
docker run --rm -it -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp golang:1.3-cross bash
docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.3-cross bash
$ for GOOS in darwin linux; do
> for GOARCH in 386 amd64; do
> go build -v -o myapp-$GOOS-$GOARCH

View File

@ -46,7 +46,7 @@ Then, run the commands to build and run the Docker image:
If you don't want to include a `Dockerfile` in your project, it is sufficient to
do the following:
docker run -it --rm --name my-apache-app -v "$(pwd)":/usr/local/apache2/htdocs/ httpd:2.4
docker run -it --rm --name my-apache-app -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4
### Configuration

View File

@ -35,7 +35,7 @@ Then, run the commands to build and run the Docker image:
If you don't want to include a `Dockerfile` in your project, it is sufficient to
do the following:
docker run -it --rm --name my-apache-app -v "$(pwd)":/usr/local/apache2/htdocs/ httpd:2.4
docker run -it --rm --name my-apache-app -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4
### Configuration

View File

@ -42,7 +42,7 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Hy script by using the Hy
Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp hylang:0.10 hy your-daemon-or-script.hy
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp hylang:0.10 hy your-daemon-or-script.hy
# License

View File

@ -32,4 +32,4 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Hy script by using the Hy
Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp hylang:0.10 hy your-daemon-or-script.hy
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp hylang:0.10 hy your-daemon-or-script.hy

View File

@ -51,7 +51,7 @@ There may be occasions where it is not appropriate to run your app inside a
container. To compile, but not run your app inside the Docker instance, you can
write something like:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java:7 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

View File

@ -36,7 +36,7 @@ There may be occasions where it is not appropriate to run your app inside a
container. To compile, but not run your app inside the Docker instance, you can
write something like:
docker run --rm -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp java:7 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

View File

@ -57,7 +57,7 @@ The `onbuid` tag expects a `Gemfile.lock` in your app directory. This `docker
run` will help you generate one. Run it in the root of your app, next to the
`Gemfile`:
docker run --rm -v "$(pwd)":/usr/src/app -w /usr/src/app jruby:1.7 bundle install --system
docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app jruby:1.7 bundle install --system
## Run a single Ruby script
@ -65,7 +65,7 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. 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 jruby:1.7 jruby your-daemon-or-script.rb
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp jruby:1.7 jruby your-daemon-or-script.rb
# License

View File

@ -42,7 +42,7 @@ The `onbuid` tag expects a `Gemfile.lock` in your app directory. This `docker
run` will help you generate one. Run it in the root of your app, next to the
`Gemfile`:
docker run --rm -v "$(pwd)":/usr/src/app -w /usr/src/app jruby:1.7 bundle install --system
docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app jruby:1.7 bundle install --system
## Run a single Ruby script
@ -50,4 +50,4 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. 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 jruby:1.7 jruby your-daemon-or-script.rb
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp jruby:1.7 jruby your-daemon-or-script.rb

View File

@ -49,7 +49,7 @@ For many simple projects, you may find it inconvenient to write a complete
In such cases, you can run a Maven project by using the Maven Docker image
directly, passing a Maven command to `docker run`:
docker run -it --rm --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.2-jdk-7 mvn clean install
docker run -it --rm --name my-maven-project -v "$PWD":/usr/src/mymaven -w /usr/src/mymaven maven:3.2-jdk-7 mvn clean install
# License

View File

@ -34,4 +34,4 @@ For many simple projects, you may find it inconvenient to write a complete
In such cases, you can run a Maven project by using the Maven Docker image
directly, passing a Maven command to `docker run`:
docker run -it --rm --name my-maven-project -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3.2-jdk-7 mvn clean install
docker run -it --rm --name my-maven-project -v "$PWD":/usr/src/mymaven -w /usr/src/mymaven maven:3.2-jdk-7 mvn clean install

View File

@ -64,7 +64,7 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Node.js script by using the
Node.js Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js
# License

View File

@ -46,4 +46,4 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Node.js script by using the
Node.js Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp node:0.10 node your-daemon-or-script.js

View File

@ -41,7 +41,7 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. 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:5.20 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
# License

View File

@ -28,4 +28,4 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. 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:5.20 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

View File

@ -54,7 +54,7 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a PHP script by using the PHP
Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp php:5.6-cli php your-script.php
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp php:5.6-cli php your-script.php
## With Apache
@ -109,7 +109,7 @@ you can use the `docker-php-ext-configure` script like this example.
If you don't want to include a `Dockerfile` in your project, it is sufficient to
do the following:
docker run -it --rm --name my-apache-php-app -v "$(pwd)":/var/www/html php:5.6-apache
docker run -it --rm --name my-apache-php-app -v "$PWD":/var/www/html php:5.6-apache
# License

View File

@ -36,7 +36,7 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a PHP script by using the PHP
Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp php:5.6-cli php your-script.php
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp php:5.6-cli php your-script.php
## With Apache
@ -91,4 +91,4 @@ you can use the `docker-php-ext-configure` script like this example.
If you don't want to include a `Dockerfile` in your project, it is sufficient to
do the following:
docker run -it --rm --name my-apache-php-app -v "$(pwd)":/var/www/html php:5.6-apache
docker run -it --rm --name my-apache-php-app -v "$PWD":/var/www/html php:5.6-apache

View File

@ -55,11 +55,11 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Python script by using the
Python Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp pypy:3 pypy3 your-daemon-or-script.py
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp pypy:3 pypy3 your-daemon-or-script.py
or (again, if you need to use Python 2):
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp pypy:2 pypy your-daemon-or-script.py
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp pypy:2 pypy your-daemon-or-script.py
# License

View File

@ -40,8 +40,8 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Python script by using the
Python Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp pypy:3 pypy3 your-daemon-or-script.py
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp pypy:3 pypy3 your-daemon-or-script.py
or (again, if you need to use Python 2):
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp pypy:2 pypy your-daemon-or-script.py
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp pypy:2 pypy your-daemon-or-script.py

View File

@ -62,11 +62,11 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Python script by using the
Python Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp python:3 python your-daemon-or-script.py
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python your-daemon-or-script.py
or (again, if you need to use Python 2):
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp python:2 python your-daemon-or-script.py
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:2 python your-daemon-or-script.py
# License

View File

@ -41,8 +41,8 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. In such cases, you can run a Python script by using the
Python Docker image directly:
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp python:3 python your-daemon-or-script.py
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3 python your-daemon-or-script.py
or (again, if you need to use Python 2):
docker run -it --rm --name my-running-script -v "$(pwd)":/usr/src/myapp -w /usr/src/myapp python:2 python your-daemon-or-script.py
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:2 python your-daemon-or-script.py

View File

@ -31,7 +31,7 @@ R is a GNU project. The source code for the R software environment is written
primarily in C, Fortran, and R. R is freely available under the GNU General
Public License, and pre-compiled binary versions are provided for various
operating systems. R uses a command line interface; however, several
graphical user interfaces are available for use with R.
graphical user interfaces are available for use with R.
> [R FAQ](http://cran.r-project.org/doc/FAQ/R-FAQ.html#What-is-R_003f)
> [wikipedia.org/wiki/R_(programming_language)](http://en.wikipedia.org/wiki/R_(programming_language))
@ -52,7 +52,7 @@ Link the working directory to run R batch commands. We recommend specifying a
non-root user when linking a volume to the container to avoid permission
changes, as illustrated here:
docker run -ti --rm -v $(pwd):/home/docker -w /home/docker -u docker r-base R CMD check .
docker run -ti --rm -v "$PWD":/home/docker -w /home/docker -u docker r-base R CMD check .
Alternatively, just run a bash session on the container first. This allows a
user to run batch commands and also edit and run scripts:
@ -112,7 +112,7 @@ You are invited to contribute new features, fixes, or updates, large or small;
we are always thrilled to receive pull requests, and do our best to process them
as fast as we can.
Before you start to code, we recommend discussing your plans
Before you start to code, we recommend discussing your plans
through a [GitHub issue](https://github.com/rocker-org/rocker/issues), especially for more ambitious
contributions. This gives other contributors a chance to point you in the right
direction, give you feedback on your design, and help you find out if someone

View File

@ -21,7 +21,7 @@ R is a GNU project. The source code for the R software environment is written
primarily in C, Fortran, and R. R is freely available under the GNU General
Public License, and pre-compiled binary versions are provided for various
operating systems. R uses a command line interface; however, several
graphical user interfaces are available for use with R.
graphical user interfaces are available for use with R.
> [R FAQ](http://cran.r-project.org/doc/FAQ/R-FAQ.html#What-is-R_003f)
> [wikipedia.org/wiki/R_(programming_language)](http://en.wikipedia.org/wiki/R_(programming_language))
@ -42,7 +42,7 @@ Link the working directory to run R batch commands. We recommend specifying a
non-root user when linking a volume to the container to avoid permission
changes, as illustrated here:
docker run -ti --rm -v $(pwd):/home/docker -w /home/docker -u docker r-base R CMD check .
docker run -ti --rm -v "$PWD":/home/docker -w /home/docker -u docker r-base R CMD check .
Alternatively, just run a bash session on the container first. This allows a
user to run batch commands and also edit and run scripts:

View File

@ -53,14 +53,14 @@ The `onbuid` tag expects a `Gemfile.lock` in your app directory. This `docker
run` will help you generate one. Run it in the root of your app, next to the
`Gemfile`:
docker run --rm -v "$(pwd)":/usr/src/app -w /usr/src/app ruby:2.1 bundle install
docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:2.1 bundle install
## Bootstrap a new Rails application
If you want to generate the scaffolding for a new Rails project, you can do the
following:
docker run -it --rm --user "$(id -u):$(id -g)" -v "$(pwd)":/usr/src/app -w /usr/src/app rails rails new webapp
docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app rails rails new webapp
This will create a sub-directory named `webapp` inside your current directory.

View File

@ -42,13 +42,13 @@ The `onbuid` tag expects a `Gemfile.lock` in your app directory. This `docker
run` will help you generate one. Run it in the root of your app, next to the
`Gemfile`:
docker run --rm -v "$(pwd)":/usr/src/app -w /usr/src/app ruby:2.1 bundle install
docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:2.1 bundle install
## Bootstrap a new Rails application
If you want to generate the scaffolding for a new Rails project, you can do the
following:
docker run -it --rm --user "$(id -u):$(id -g)" -v "$(pwd)":/usr/src/app -w /usr/src/app rails rails new webapp
docker run -it --rm --user "$(id -u):$(id -g)" -v "$PWD":/usr/src/app -w /usr/src/app rails rails new webapp
This will create a sub-directory named `webapp` inside your current directory.

View File

@ -29,7 +29,7 @@ will bind to all network interfaces available to the container (by default,
RethinkDB only accepts connections from `localhost`).
```bash
docker run --name some-rethink -v "$(pwd):/data" -d rethinkdb
docker run --name some-rethink -v "$PWD:/data" -d rethinkdb
```
## Connect the instance to an application

View File

@ -16,7 +16,7 @@ will bind to all network interfaces available to the container (by default,
RethinkDB only accepts connections from `localhost`).
```bash
docker run --name some-rethink -v "$(pwd):/data" -d rethinkdb
docker run --name some-rethink -v "$PWD:/data" -d rethinkdb
```
## Connect the instance to an application

View File

@ -55,7 +55,7 @@ The `onbuid` tag expects a `Gemfile.lock` in your app directory. This `docker
run` will help you generate one. Run it in the root of your app, next to the
`Gemfile`:
docker run --rm -v "$(pwd)":/usr/src/app -w /usr/src/app ruby:2.1 bundle install
docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:2.1 bundle install
## Run a single Ruby script
@ -63,7 +63,7 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. 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:2.1 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 ruby your-daemon-or-script.rb
# License

View File

@ -34,7 +34,7 @@ The `onbuid` tag expects a `Gemfile.lock` in your app directory. This `docker
run` will help you generate one. Run it in the root of your app, next to the
`Gemfile`:
docker run --rm -v "$(pwd)":/usr/src/app -w /usr/src/app ruby:2.1 bundle install
docker run --rm -v "$PWD":/usr/src/app -w /usr/src/app ruby:2.1 bundle install
## Run a single Ruby script
@ -42,4 +42,4 @@ For many simple, single file projects, you may find it inconvenient to write a
complete `Dockerfile`. 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:2.1 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 ruby your-daemon-or-script.rb

View File

@ -24,7 +24,7 @@ This is image is intended to run as an executable. Files are provided
by mounting a directory. Here's an example of compiling
`service.thrift` to ruby to the current directory.
docker run -v "$(pwd):/data" thrift thrift -o /data --gen rb /data/service.thrift
docker run -v "$PWD:/data" thrift thrift -o /data --gen rb /data/service.thrift
Note, that you may want to include `-u $(id -u)` to set the UID on
generated files. The thrift process runs as root by default which will

View File

@ -14,7 +14,7 @@ This is image is intended to run as an executable. Files are provided
by mounting a directory. Here's an example of compiling
`service.thrift` to ruby to the current directory.
docker run -v "$(pwd):/data" thrift thrift -o /data --gen rb /data/service.thrift
docker run -v "$PWD:/data" thrift thrift -o /data --gen rb /data/service.thrift
Note, that you may want to include `-u $(id -u)` to set the UID on
generated files. The thrift process runs as root by default which will