Skip to content

Commit 4d83c1b

Browse files
frdmnjohndmulhausen
authored andcommitted
Add missing dollar-sign / consistent shell style (docker#426)
* Add missing dollar-sign * Remove dollar-sign for single commands without output
1 parent 3dff287 commit 4d83c1b

11 files changed

+26
-34
lines changed

compose/django.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ In this step, you create a Django started project by building the image from the
8989

9090
2. Create the Django project using the `docker-compose` command.
9191

92-
$ docker-compose run web django-admin.py startproject composeexample .
92+
docker-compose run web django-admin.py startproject composeexample .
9393

9494
This instructs Compose to run `django-admin.py startproject composeeexample`
9595
in a container, using the `web` service's image and configuration. Because

compose/environment-variables.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ You can pass multiple environment variables from an external file through to a s
5050

5151
Just like with `docker run -e`, you can set environment variables on a one-off container with `docker-compose run -e`:
5252

53-
$ docker-compose run -e DEBUG=1 web python console.py
53+
docker-compose run -e DEBUG=1 web python console.py
5454

5555
You can also pass a variable through from the shell by not giving it a value:
5656

57-
$ docker-compose run -e DEBUG web python console.py
57+
docker-compose run -e DEBUG web python console.py
5858

5959
The value of the `DEBUG` variable in the container will be taken from the value for the same variable in the shell in which Compose is run.
6060

@@ -83,7 +83,6 @@ When you run `docker-compose up`, the `web` service defined above uses the image
8383
Values in the shell take precedence over those specified in the `.env` file. If you set `TAG` to a different value in your shell, the substitution in `image` uses that instead:
8484

8585
$ export TAG=v2.0
86-
8786
$ docker-compose config
8887
version: '2.0'
8988
services:
@@ -94,7 +93,6 @@ Values in the shell take precedence over those specified in the `.env` file. If
9493

9594
Several environment variables are available for you to configure the Docker Compose command-line behaviour. They begin with `COMPOSE_` or `DOCKER_`, and are documented in [CLI Environment Variables](reference/envvars.md).
9695

97-
9896
## Environment variables created by links
9997

10098
When using the ['links' option](compose-file.md#links) in a [v1 Compose file](compose-file.md#version-1), environment variables will be created for each link. They are documented in the [Link environment variables reference](link-env-deprecated.md). Please note, however, that these variables are deprecated - you should just use the link alias as a hostname instead.

compose/gettingstarted.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ The `docker-compose run` command allows you to run one-off commands for your
163163
services. For example, to see what environment variables are available to the
164164
`web` service:
165165

166-
$ docker-compose run web env
166+
docker-compose run web env
167167

168168
See `docker-compose --help` to see other available commands. You can also install [command completion](completion.md) for the bash and zsh shell, which will also show you available commands.
169169

170170
If you started Compose with `docker-compose up -d`, you'll probably want to stop
171171
your services once you've finished with them:
172172

173-
$ docker-compose stop
173+
docker-compose stop
174174

175175
At this point, you have seen the basics of how Compose works.
176176

compose/install.md

+7-9
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ which the release page specifies, in your terminal.
3131

3232
The following is an example command illustrating the format:
3333

34-
curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose
34+
$ curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose
3535

3636
If you have problems installing with `curl`, see
3737
[Alternative Install Options](install.md#alternative-install-options).
3838

3939
5. Apply executable permissions to the binary:
4040

41-
$ chmod +x /usr/local/bin/docker-compose
41+
chmod +x /usr/local/bin/docker-compose
4242

4343
6. Optionally, install [command completion](completion.md) for the
4444
`bash` and `zsh` shell.
@@ -60,7 +60,7 @@ have python system packages that conflict with docker-compose dependencies. See
6060
the [virtualenv tutorial](http://docs.python-guide.org/en/latest/dev/virtualenvs/)
6161
to get started.
6262

63-
$ pip install docker-compose
63+
pip install docker-compose
6464

6565
> **Note:** pip version 6.0 or greater is required
6666
@@ -92,24 +92,22 @@ to run so that you don't end up with two sets of them. If you want to keep using
9292
your existing containers (for example, because they have data volumes you want
9393
to preserve) you can use compose 1.5.x to migrate them with the following command:
9494

95-
$ docker-compose migrate-to-labels
95+
docker-compose migrate-to-labels
9696

9797
Alternatively, if you're not worried about keeping them, you can remove them.
9898
Compose will just create new ones.
9999

100-
$ docker rm -f -v myapp_web_1 myapp_db_1 ...
101-
100+
docker rm -f -v myapp_web_1 myapp_db_1 ...
102101

103102
## Uninstallation
104103

105104
To uninstall Docker Compose if you installed using `curl`:
106105

107-
$ rm /usr/local/bin/docker-compose
108-
106+
rm /usr/local/bin/docker-compose
109107

110108
To uninstall Docker Compose if you installed using `pip`:
111109

112-
$ pip uninstall docker-compose
110+
pip uninstall docker-compose
113111

114112
>**Note**: If you get a "Permission denied" error using either of the above
115113
>methods, you probably do not have the proper permissions to remove

compose/production.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ can be applied over the original `docker-compose.yml` to create a new configurat
3434
Once you've got a second configuration file, tell Compose to use it with the
3535
`-f` option:
3636

37-
$ docker-compose -f docker-compose.yml -f production.yml up -d
37+
docker-compose -f docker-compose.yml -f production.yml up -d
3838

3939
See [Using multiple compose files](extends.md#different-environments) for a more
4040
complete example.

compose/rails.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Next, create a bootstrap `Gemfile` which just loads Rails. It'll be overwritten
3434

3535
You'll need an empty `Gemfile.lock` in order to build our `Dockerfile`.
3636

37-
$ touch Gemfile.lock
37+
touch Gemfile.lock
3838

3939
Finally, `docker-compose.yml` is where the magic happens. This file describes
4040
the services that comprise your app (a database and a web app), how to get each
@@ -61,7 +61,7 @@ to link them together and expose the web app's port.
6161
With those three files in place, you can now generate the Rails skeleton app
6262
using `docker-compose run`:
6363

64-
$ docker-compose run web rails new . --force --database=postgresql --skip-bundle
64+
docker-compose run web rails new . --force --database=postgresql --skip-bundle
6565

6666
First, Compose will build the image for the `web` service using the `Dockerfile`. Then it'll run `rails new` inside a new container, using that image. Once it's done, you should have generated a fresh app:
6767

@@ -105,8 +105,7 @@ Now that you've got a new `Gemfile`, you need to build the image again. (This,
105105
and changes to the Dockerfile itself, should be the only times you'll need to
106106
rebuild.)
107107

108-
$ docker-compose build
109-
108+
docker-compose build
110109

111110
### Connect the database
112111

@@ -132,7 +131,7 @@ Replace the contents of `config/database.yml` with the following:
132131

133132
You can now boot the app with:
134133

135-
$ docker-compose up
134+
docker-compose up
136135

137136
If all's well, you should see some PostgreSQL output, and then—after a few
138137
seconds—the familiar refrain:
@@ -143,7 +142,7 @@ seconds—the familiar refrain:
143142

144143
Finally, you need to create the database. In another terminal, run:
145144

146-
$ docker-compose run web rake db:create
145+
docker-compose run web rake db:create
147146

148147
That's it. Your app should now be running on port 3000 on your Docker daemon. If you're using [Docker Machine](/machine/overview.md), then `docker-machine ip MACHINE_VM` returns the Docker host IP address.
149148

compose/reference/kill.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Options:
1414
Forces running containers to stop by sending a `SIGKILL` signal. Optionally the
1515
signal can be passed, for example:
1616

17-
$ docker-compose kill -s SIGINT
17+
docker-compose kill -s SIGINT

compose/reference/run.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@ Options:
2424

2525
Runs a one-time command against a service. For example, the following command starts the `web` service and runs `bash` as its command.
2626

27-
$ docker-compose run web bash
27+
docker-compose run web bash
2828

2929
Commands you use with `run` start in new containers with the same configuration as defined by the service' configuration. This means the container has the same volumes, links, as defined in the configuration file. There two differences though.
3030

3131
First, the command passed by `run` overrides the command defined in the service configuration. For example, if the `web` service configuration is started with `bash`, then `docker-compose run web python app.py` overrides it with `python app.py`.
3232

3333
The second difference is the `docker-compose run` command does not create any of the ports specified in the service configuration. This prevents the port collisions with already open ports. If you *do want* the service's ports created and mapped to the host, specify the `--service-ports` flag:
3434

35-
$ docker-compose run --service-ports web python manage.py shell
35+
docker-compose run --service-ports web python manage.py shell
3636

3737
Alternatively manual port mapping can be specified. Same as when running Docker's `run` command - using `--publish` or `-p` options:
3838

39-
$ docker-compose run --publish 8080:80 -p 2022:22 -p 127.0.0.1:2021:21 web python manage.py shell
39+
docker-compose run --publish 8080:80 -p 2022:22 -p 127.0.0.1:2021:21 web python manage.py shell
4040

4141
If you start a service configured with links, the `run` command first checks to see if the linked service is running and starts the service if it is stopped. Once all the linked services are running, the `run` executes the command you passed it. So, for example, you could run:
4242

43-
$ docker-compose run db psql -h db -U docker
43+
docker-compose run db psql -h db -U docker
4444

4545
This would open up an interactive PostgreSQL shell for the linked `db` container.
4646

4747
If you do not want the `run` command to start linked containers, specify the `--no-deps` flag:
4848

49-
$ docker-compose run --no-deps web python manage.py shell
49+
docker-compose run --no-deps web python manage.py shell

compose/reference/scale.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Sets the number of containers to run for a service.
1212

1313
Numbers are specified as arguments in the form `service=num`. For example:
1414

15-
$ docker-compose scale web=2 worker=3
15+
docker-compose scale web=2 worker=3

compose/swarm.md

-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ set up a Swarm cluster with [Docker Machine](/machine/overview.md) and the overl
2828
$ eval "$(docker-machine env --swarm <name of swarm master machine>)"
2929
$ docker-compose up
3030

31-
3231
## Limitations
3332

3433
### Building images
@@ -136,7 +135,6 @@ There are two viable workarounds for this problem:
136135
$ docker-compose rm -f web
137136
$ docker-compose up web
138137

139-
140138
## Scheduling containers
141139

142140
### Automatic scheduling

compose/wordpress.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ with Docker containers. This quick-start guide demonstrates how to use Compose t
2020

2121
For example, if you named your directory `my_wordpress`:
2222

23-
$ cd my_wordpress/
23+
cd my_wordpress/
2424

2525
3. Create a `docker-compose.yml` file that will start your
2626
`Wordpress` blog and a separate `MySQL` instance with a volume
@@ -97,7 +97,6 @@ At this point, WordPress should be running on port `8000` of your Docker Host, a
9797
9898
![WordPress Welcome](images/wordpress-welcome.png)
9999
100-
101100
## More Compose documentation
102101
103102
- [User guide](index.md)

0 commit comments

Comments
 (0)