Skip to content

Commit a17a47d

Browse files
author
Misty Stanley-Jones
authored
Favor docker <object> <verb> format of commands (docker#5914)
Remove instances of: - docker rmi - docker images - docker stop - docker rm - docker create - docker exec - docker attach
1 parent 0e06479 commit a17a47d

File tree

35 files changed

+93
-93
lines changed

35 files changed

+93
-93
lines changed

compose/install.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Alternatively, if you're not worried about keeping them, you can remove them.
216216
Compose just creates new ones.
217217

218218
```bash
219-
docker rm -f -v myapp_web_1 myapp_db_1 ...
219+
docker container rm -f -v myapp_web_1 myapp_db_1 ...
220220
```
221221

222222
## Uninstallation

config/containers/logging/gelf.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ To make the configuration permanent, you can configure it in `/etc/docker/daemon
6161
```
6262

6363
You can set the logging driver for a specific container by setting the
64-
`--log-driver` flag when using `docker create` or `docker run`:
64+
`--log-driver` flag when using `docker container create` or `docker run`:
6565

6666
```bash
6767
$ docker run \

config/containers/logging/json-file.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ option.
3737
Restart Docker for the changes to take effect for newly created containers. Existing containers do not use the new logging configuration.
3838

3939
You can set the logging driver for a specific container by using the
40-
`--log-driver` flag to `docker create` or `docker run`:
40+
`--log-driver` flag to `docker container create` or `docker run`:
4141

4242
```bash
4343
$ docker run \

config/containers/logging/syslog.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Restart Docker for the changes to take effect.
5757
> **Note**: The syslog-address supports both UDP and TCP.
5858
5959
You can set the logging driver for a specific container by using the
60-
`--log-driver` flag to `docker create` or `docker run`:
60+
`--log-driver` flag to `docker container create` or `docker run`:
6161

6262
```bash
6363
docker run \

config/thirdparty/ambassador_pattern_linking.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ containers `env`:
124124
This environment is used by the ambassador `socat` script to expose Redis
125125
to the world (via the `-p 6379:6379` port mapping):
126126

127-
$ docker rm redis_ambassador
127+
$ docker container rm redis_ambassador
128128
$ CMD="apk update && apk add socat && sh"
129129
$ docker run -t -i --link redis:redis --name redis_ambassador -p 6379:6379 alpine:3.2 sh -c "$CMD"
130130
[...]

config/thirdparty/dsc.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ file and execute configurations against multiple nodes as such:
9090

9191
### Images
9292
Image configuration is equivalent to running: `docker pull [image]` or
93-
`docker rmi -f [IMAGE]`.
93+
`docker image rm -f [IMAGE]`.
9494

9595
Using the same steps defined above, execute `DockerClient` with the `Image`
9696
parameter and apply the configuration:
@@ -124,7 +124,7 @@ docker run -d --name="[containername]" -p '[port]' -e '[env]' --link '[link]'\
124124
or
125125

126126
```
127-
docker rm -f [containername]
127+
docker container rm -f [containername]
128128
```
129129

130130
To create or remove containers, you can use the `Container` parameter with one

develop/develop-images/multistage-build.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ echo Building alexellis2/href-counter:build
6969
docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy \
7070
-t alexellis2/href-counter:build . -f Dockerfile.build
7171

72-
docker create --name extract alexellis2/href-counter:build
73-
docker cp extract:/go/src/github.com/alexellis/href-counter/app ./app
74-
docker rm -f extract
72+
docker container create --name extract alexellis2/href-counter:build
73+
docker container cp extract:/go/src/github.com/alexellis/href-counter/app ./app
74+
docker container rm -f extract
7575

7676
echo Building alexellis2/href-counter:latest
7777

develop/sdk/examples.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ Reticulating spline 5...
437437

438438
## List all images
439439

440-
List the images on your Engine, similar to `docker images`:
440+
List the images on your Engine, similar to `docker image ls`:
441441

442442
<ul class="nav nav-tabs">
443443
<li class="active"><a data-toggle="tab" data-target="#tab-listimages-go" data-group="go">Go</a></li>

docker-for-mac/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ docker-machine version 0.10.0, build 76ed2a6
8888
8989
The `nginx` webserver continues to run in the container on that port
9090
until you stop and/or remove the container. If you want to stop the
91-
webserver, type: `docker stop webserver` and start it again with `docker
91+
webserver, type: `docker container stop webserver` and start it again with `docker
9292
start webserver`. A stopped container does not show up with `docker ps`; for
9393
that, you need to run `docker ps -a`.
9494
9595
To stop and remove the running container with a single command, type:
96-
`docker rm -f webserver`. This removes the container, but not the
97-
`nginx` image. You can list local images with `docker images`. You might
96+
`docker container rm -f webserver`. This removes the container, but not the
97+
`nginx` image. You can list local images with `docker image ls`. You might
9898
want to keep some images around so that you don't need to pull them again
99-
from Docker Hub. To remove an image you no longer need, use `docker rmi` followed by an image ID or image name. For example, `docker rmi nginx`.
99+
from Docker Hub. To remove an image you no longer need, use `docker image rm` followed by an image ID or image name. For example, `docker image rm nginx`.
100100
101101
**Want more example applications?** [Get Started](/get-started/) and [Samples](/samples/) are great places to start.
102102

docker-for-windows/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,14 @@ and make sure `docker` commands are working properly.
228228
229229
The `nginx` webserver continues to run in the container on that port
230230
until you stop and/or remove the container. If you want to stop the
231-
webserver, type: `docker stop webserver` and start it again with `docker
231+
webserver, type: `docker container stop webserver` and start it again with `docker
232232
start webserver`.
233233
234234
To stop and remove the running container with a single command, type:
235-
`docker rm -f webserver`. This removes the container, but not the
236-
`nginx` image. You can list local images with `docker images`. You might
235+
`docker container rm -f webserver`. This removes the container, but not the
236+
`nginx` image. You can list local images with `docker image ls`. You might
237237
want to keep some images around so that you don't need to pull them again
238-
from Docker Hub. To remove an image you no longer need, use `docker rmi` followed by an image ID or image name. For example, `docker rmi nginx`.
238+
from Docker Hub. To remove an image you no longer need, use `docker image rm` followed by an image ID or image name. For example, `docker image rm nginx`.
239239
240240
**Want more example applications?** [Get Started](/get-started/) and [Samples](/samples) are great places to start.
241241

engine/docker-overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ the default registry configuration):
193193
1. If you do not have the `ubuntu` image locally, Docker pulls it from your
194194
configured registry, as though you had run `docker pull ubuntu` manually.
195195

196-
2. Docker creates a new container, as though you had run a `docker create`
196+
2. Docker creates a new container, as though you had run a `docker container create`
197197
command manually.
198198

199199
3. Docker allocates a read-write filesystem to the container, as its final

engine/examples/apt-cacher-ng.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@ instruction, and the image we built to run the service:
116116
Finally, clean up after your test by stopping and removing the
117117
container, and then removing the image.
118118

119-
$ docker stop test_apt_cacher_ng
120-
$ docker rm test_apt_cacher_ng
121-
$ docker rmi eg_apt_cacher_ng
119+
$ docker container stop test_apt_cacher_ng
120+
$ docker container rm test_apt_cacher_ng
121+
$ docker image rm eg_apt_cacher_ng

engine/examples/running_ssh_service.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Finally, clean up after your test by stopping and removing the
7676
container, and then removing the image.
7777

7878
```bash
79-
$ docker stop test_sshd
80-
$ docker rm test_sshd
81-
$ docker rmi eg_sshd
79+
$ docker container stop test_sshd
80+
$ docker container rm test_sshd
81+
$ docker image rm eg_sshd
8282
```

engine/security/apparmor.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Docker automatically generates and loads a default profile for containers named
1313
`docker-default`. On Docker versions `1.13.0` and later, the Docker binary generates
1414
this profile in `tmpfs` and then loads it into the kernel. On Docker versions
1515
earlier than `1.13.0`, this profile is generated in `/etc/apparmor.d/docker`
16-
instead.
16+
instead.
1717

1818
> **Note**: This profile is used on containers, _not_ on the Docker Daemon.
1919
@@ -176,7 +176,7 @@ profile docker-nginx flags=(attach_disconnected,mediate_deleted) {
176176
4. Exec into the running container.
177177

178178
```bash
179-
$ docker exec -it apparmor-nginx bash
179+
$ docker container exec -it apparmor-nginx bash
180180
```
181181

182182
5. Try some operations to test the profile.
@@ -222,7 +222,7 @@ In the above example, you can see `profile=/usr/bin/docker`. This means the
222222
user has the `docker-engine` (Docker Engine Daemon) profile loaded.
223223

224224
> **Note**: On version of Ubuntu > 14.04 this is all fine and well, but Trusty
225-
> users might run into some issues when trying to `docker exec`.
225+
> users might run into some issues when trying to `docker container exec`.
226226
227227
Look at another log line:
228228

engine/security/trust/trust_sandbox.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Now that everything is setup, you can go into your `trustsandbox` container and
127127
start testing Docker content trust. From your host machine, obtain a shell
128128
in the `trustsandbox` container.
129129

130-
$ docker exec -it trustsandbox sh
130+
$ docker container exec -it trustsandbox sh
131131
/ #
132132

133133
### Test some trust operations
@@ -217,7 +217,7 @@ data. Then, you try and pull it.
217217
2. Open a new interactive terminal from your host, and obtain a shell into the
218218
`sandboxregistry` container.
219219

220-
$ docker exec -it sandboxregistry bash
220+
$ docker container exec -it sandboxregistry bash
221221
root@65084fc6f047:/#
222222

223223
3. List the layers for the `test/trusttest` image you pushed:
@@ -242,15 +242,15 @@ data. Then, you try and pull it.
242242

243243
7. List the `trusttest` image.
244244

245-
/ # docker images | grep trusttest
245+
/ # docker image ls | grep trusttest
246246
REPOSITORY TAG IMAGE ID CREATED SIZE
247247
docker/trusttest latest cc7629d1331a 11 months ago 5.025 MB
248248
sandboxregistry:5000/test/trusttest latest cc7629d1331a 11 months ago 5.025 MB
249249
sandboxregistry:5000/test/trusttest <none> cc7629d1331a 11 months ago 5.025 MB
250250

251251
8. Remove the `trusttest:latest` image from our local cache.
252252

253-
/ # docker rmi -f cc7629d1331a
253+
/ # docker image rm -f cc7629d1331a
254254
Untagged: docker/trusttest:latest
255255
Untagged: sandboxregistry:5000/test/trusttest:latest
256256
Untagged: sandboxregistry:5000/test/trusttest@sha256:ebf59c538accdf160ef435f1a19938ab8c0d6bd96aef8d4ddd1b379edf15a926

engine/security/userns-remap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ See
243243
for some of these limitations.
244244
245245
To disable user namespaces for a specific container, add the `--userns=host`
246-
flag to the `docker create`, `docker run`, or `docker exec` command.
246+
flag to the `docker container create`, `docker container run`, or `docker container exec` command.
247247
248248
## User namespace known limitations
249249

engine/swarm/configs.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ real-world example, continue to
158158
```
159159

160160
4. Get the ID of the `redis` service task container using `docker ps`, so that
161-
you can use `docker exec` to connect to the container and read the contents
161+
you can use `docker container exec` to connect to the container and read the contents
162162
of the config data file, which defaults to being readable by all and has the
163163
same name as the name of the config. The first command below illustrates
164164
how to find the container ID, and the second and third commands use shell
@@ -169,11 +169,11 @@ real-world example, continue to
169169
170170
5cb1c2348a59
171171
172-
$ docker exec $(docker ps --filter name=redis -q) ls -l /my-config
172+
$ docker container exec $(docker ps --filter name=redis -q) ls -l /my-config
173173
174174
-r--r--r-- 1 root root 12 Jun 5 20:49 my-config
175175
176-
$ docker exec $(docker ps --filter name=redis -q) cat /my-config
176+
$ docker container exec $(docker ps --filter name=redis -q) cat /my-config
177177
178178
This is a config
179179
```
@@ -207,7 +207,7 @@ real-world example, continue to
207207
`service update` command redeploys the service.
208208

209209
```none
210-
$ docker exec -it $(docker ps --filter name=redis -q) cat /my-config
210+
$ docker container exec -it $(docker ps --filter name=redis -q) cat /my-config
211211
212212
cat: can't open '/my-config': No such file or directory
213213
```

engine/swarm/secrets.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ real-world example, continue to
197197
```
198198

199199
4. Get the ID of the `redis` service task container using `docker ps` , so that
200-
you can use `docker exec` to connect to the container and read the contents
200+
you can use `docker container exec` to connect to the container and read the contents
201201
of the secret data file, which defaults to being readable by all and has the
202202
same name as the name of the secret. The first command below illustrates
203203
how to find the container ID, and the second and third commands use shell
@@ -208,12 +208,12 @@ real-world example, continue to
208208
209209
5cb1c2348a59
210210
211-
$ docker exec $(docker ps --filter name=redis -q) ls -l /run/secrets
211+
$ docker container exec $(docker ps --filter name=redis -q) ls -l /run/secrets
212212
213213
total 4
214214
-r--r--r-- 1 root root 17 Dec 13 22:48 my_secret_data
215215
216-
$ docker exec $(docker ps --filter name=redis -q) cat /run/secrets/my_secret_data
216+
$ docker container exec $(docker ps --filter name=redis -q) cat /run/secrets/my_secret_data
217217
218218
This is a secret
219219
```
@@ -257,7 +257,7 @@ real-world example, continue to
257257
`service update` command redeploys the service.
258258
259259
```none
260-
$ docker exec -it $(docker ps --filter name=redis -q) cat /run/secrets/my_secret_data
260+
$ docker container exec -it $(docker ps --filter name=redis -q) cat /run/secrets/my_secret_data
261261
262262
cat: can't open '/run/secrets/my_secret_data': No such file or directory
263263
```
@@ -898,14 +898,14 @@ use it, then remove the old secret.
898898
uses shell expansion to do it all in a single step.
899899
900900
```bash
901-
$ docker exec <CONTAINER_ID> \
901+
$ docker container exec <CONTAINER_ID> \
902902
bash -c 'mysqladmin --user=wordpress --password="$(< /run/secrets/old_mysql_password)" password "$(< /run/secrets/mysql_password)"'
903903
```
904904
905905
**or**:
906906
907907
```bash
908-
$ docker exec $(docker ps --filter name=mysql -q) \
908+
$ docker container exec $(docker ps --filter name=mysql -q) \
909909
bash -c 'mysqladmin --user=wordpress --password="$(< /run/secrets/old_mysql_password)" password "$(< /run/secrets/mysql_password)"'
910910
```
911911

engine/tutorials/networkingcontainers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ Then, get the IP address of your `web`
175175

176176
Now, open a shell to your running `db` container:
177177

178-
$ docker exec -it db bash
178+
$ docker container exec -it db bash
179179

180180
root@a205f0dd33b2:/# ping 172.17.0.2
181181
ping 172.17.0.2
@@ -195,7 +195,7 @@ Docker networking allows you to attach a container to as many networks as you li
195195

196196
Open a shell into the `db` application again and try the ping command. This time just use the container name `web` rather than the IP address.
197197

198-
$ docker exec -it db bash
198+
$ docker container exec -it db bash
199199

200200
root@a205f0dd33b2:/# ping web
201201
PING web (10.0.0.2) 56(84) bytes of data.

engine/userguide/networking/default_network/dockerlinks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ You can also use `docker inspect` to return the container's name.
145145
> **Note**:
146146
> Container names must be unique. That means you can only call
147147
> one container `web`. If you want to re-use a container name you must delete
148-
> the old container (with `docker rm`) before you can create a new
148+
> the old container (with `docker container rm`) before you can create a new
149149
> container with the same name. As an alternative you can use the `--rm`
150150
> flag with the `docker run` command. This deletes the container
151151
> immediately after it is stopped.
@@ -166,7 +166,7 @@ image, which contains a PostgreSQL database.
166166
Now, you need to delete the `web` container you created previously so you can replace it
167167
with a linked one:
168168

169-
$ docker rm -f web
169+
$ docker container rm -f web
170170

171171
Now, create a new `web` container and link it with your `db` container.
172172

engine/userguide/networking/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ container lacks a network interface. Attaching to such a container and looking
7777
at its stack you see this:
7878

7979
```bash
80-
$ docker attach nonenetcontainer
80+
$ docker container attach nonenetcontainer
8181

8282
root@0cb243cd1293:/# cat /etc/hosts
8383
127.0.0.1 localhost
@@ -223,7 +223,7 @@ inside the container. You are connected as `root`, so your command prompt is
223223
a `#` character.
224224

225225
```none
226-
$ docker attach container1
226+
$ docker container attach container1
227227
228228
root@3386a527aa08:/# ip -4 addr
229229

engine/userguide/networking/overlay-standalone-swarm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ to have external connectivity outside of their cluster.
381381
2. Check the Nginx container's network interfaces.
382382
383383
```bash
384-
$ docker exec web ip addr
384+
$ docker container exec web ip addr
385385
386386
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
387387
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

0 commit comments

Comments
 (0)