Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions _data/engine-cli/docker_attach.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ options:
examples: |-
### Attach to and detach from a running container

```bash
```console
$ docker run -d --name topdemo ubuntu /usr/bin/top -b

$ docker attach topdemo
Expand Down Expand Up @@ -139,24 +139,21 @@ examples: |-
And in this second example, you can see the exit code returned by the `bash`
process is returned by the `docker attach` command to its caller too:

```bash
$ docker run --name test -d -it debian
```console
$ docker run --name test -d -it debian
275c44472aebd77c926d4527885bb09f2f6db21d878c75f0a1c212c03d3bcfab

275c44472aebd77c926d4527885bb09f2f6db21d878c75f0a1c212c03d3bcfab
$ docker attach test
root@f38c87f2a42d:/# exit 13

$ docker attach test
exit

root@f38c87f2a42d:/# exit 13

exit

$ echo $?

13
$ echo $?
13

$ docker ps -a | grep test
$ docker ps -a | grep test

275c44472aeb debian:7 "/bin/bash" 26 seconds ago Exited (13) 17 seconds ago test
275c44472aeb debian:7 "/bin/bash" 26 seconds ago Exited (13) 17 seconds ago test
```
deprecated: false
experimental: false
Expand Down
63 changes: 32 additions & 31 deletions _data/engine-cli/docker_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ long: |-
For example, run this command to use a directory called `docker` in the branch
`container`:

```bash
```console
$ docker build https://github.com/docker/rootfs.git#container:docker
```

Expand Down Expand Up @@ -62,7 +62,7 @@ long: |-

If you pass an URL to a remote tarball, the URL itself is sent to the daemon:

```bash
```console
$ docker build http://server/context.tar.gz
```

Expand All @@ -78,7 +78,7 @@ long: |-
Instead of specifying a context, you can pass a single `Dockerfile` in the
`URL` or pipe the file in via `STDIN`. To pipe a `Dockerfile` from `STDIN`:

```bash
```console
$ docker build - < Dockerfile
```

Expand Down Expand Up @@ -436,7 +436,7 @@ options:
examples: |-
### Build with PATH

```bash
```console
$ docker build .

Uploading context 10240 bytes
Expand Down Expand Up @@ -481,15 +481,15 @@ examples: |-

### Build with URL

```bash
```console
$ docker build github.com/creack/docker-firefox
```

This will clone the GitHub repository and use the cloned repository as context.
The Dockerfile at the root of the repository is used as Dockerfile. You can
specify an arbitrary Git repository by using the `git://` or `git@` scheme.

```bash
```console
$ docker build -f ctx/Dockerfile http://server/ctx.tar.gz

Downloading context: http://server/ctx.tar.gz [===================>] 240 B/240 B
Expand All @@ -515,7 +515,7 @@ examples: |-

### Build with -

```bash
```console
$ docker build - < Dockerfile
```

Expand All @@ -524,7 +524,7 @@ examples: |-
Since there is no context, a Dockerfile `ADD` only works if it refers to a
remote URL.

```bash
```console
$ docker build - < context.tar.gz
```

Expand All @@ -533,7 +533,7 @@ examples: |-

### Use a .dockerignore file

```bash
```console
$ docker build .

Uploading context 18.829 MB
Expand Down Expand Up @@ -572,7 +572,7 @@ examples: |-

### Tag an image (-t)

```bash
```console
$ docker build -t vieux/apache:2.0 .
```

Expand All @@ -586,27 +586,27 @@ examples: |-
For example, to tag an image both as `whenry/fedora-jboss:latest` and
`whenry/fedora-jboss:v2.1`, use the following:

```bash
```console
$ docker build -t whenry/fedora-jboss:latest -t whenry/fedora-jboss:v2.1 .
```

### Specify a Dockerfile (-f)

```bash
```console
$ docker build -f Dockerfile.debug .
```

This will use a file called `Dockerfile.debug` for the build instructions
instead of `Dockerfile`.

```bash
```console
$ curl example.com/remote/Dockerfile | docker build -f - .
```

The above command will use the current directory as the build context and read
a Dockerfile from stdin.

```bash
```console
$ docker build -f dockerfiles/Dockerfile.debug -t myapp_debug .
$ docker build -f dockerfiles/Dockerfile.prod -t myapp_prod .
```
Expand All @@ -615,7 +615,7 @@ examples: |-
`.`) twice, once using a debug version of a `Dockerfile` and once using a
production version.

```bash
```console
$ cd /home/me/myapp/some/dir/really/deep
$ docker build -f /home/me/myapp/dockerfiles/debug /home/me/myapp
$ docker build -f ../../../../dockerfiles/debug /home/me/myapp
Expand Down Expand Up @@ -658,7 +658,7 @@ examples: |-
files. The `ARG` instruction lets Dockerfile authors define values that users
can set at build-time using the `--build-arg` flag:

```bash
```console
$ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 --build-arg FTP_PROXY=http://40.50.60.5:4567 .
```

Expand All @@ -677,7 +677,7 @@ examples: |-
from the local environment will be propagated into the Docker container being
built:

```bash
```console
$ export HTTP_PROXY=http://10.20.30.2:1234
$ docker build --build-arg HTTP_PROXY .
```
Expand Down Expand Up @@ -729,7 +729,7 @@ examples: |-
...
```

```bash
```console
$ docker build -t mybuildimage --target build-env .
```

Expand All @@ -754,7 +754,7 @@ examples: |-
context, and exports the files to a directory named `out` in the current directory.
If the directory does not exist, Docker creates the directory automatically:

```bash
```console
$ docker build -o out .
```

Expand All @@ -763,13 +763,13 @@ examples: |-
using the long-hand CSV syntax, specifying both `type` and `dest` (destination
path):

```bash
```console
$ docker build --output type=local,dest=out .
```

Use the `tar` type to export the files as a `.tar` archive:

```bash
```console
$ docker build --output type=tar,dest=out.tar .
```

Expand All @@ -778,8 +778,8 @@ examples: |-
and writes the output tarball to standard output, which is then redirected to
the `out.tar` file:

```bash
docker build -o - . > out.tar
```console
$ docker build -o - . > out.tar
```

The `--output` option exports all files from the target stage. A common pattern
Expand All @@ -800,7 +800,7 @@ examples: |-
When building the Dockerfile with the `-o` option, only the files from the final
stage are exported to the `out` directory, in this case, the `vndr` binary:

```bash
```console
$ docker build -o out .

[+] Building 2.3s (7/7) FINISHED
Expand Down Expand Up @@ -848,16 +848,17 @@ examples: |-
The following example builds an image with inline-cache metadata and pushes it
to a registry, then uses the image as a cache source on another machine:

```bash
```console
$ docker build -t myname/myapp --build-arg BUILDKIT_INLINE_CACHE=1 .
$ docker push myname/myapp
```

After pushing the image, the image is used as cache source on another machine.
BuildKit automatically pulls the image from the registry if needed.

```bash
# on another machine
On another machine:

```console
$ docker build --cache-from myname/myapp .
```

Expand Down Expand Up @@ -963,7 +964,7 @@ examples: |-

Then make sure the experimental flag is enabled:

```bash
```console
$ docker version -f '{{.Server.Experimental}}'
true
```
Expand All @@ -983,15 +984,15 @@ examples: |-

An image named `test` is built with `--squash` argument.

```bash
```console
$ docker build --squash -t test .

[...]
<...>
```

If everything is right, the history looks like this:

```bash
```console
$ docker history test

IMAGE CREATED CREATED BY SIZE COMMENT
Expand Down
6 changes: 3 additions & 3 deletions _data/engine-cli/docker_commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ options:
examples: |-
### Commit a container

```bash
```console
$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Expand All @@ -81,7 +81,7 @@ examples: |-

### Commit a container with new configurations

```bash
```console
$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Expand All @@ -103,7 +103,7 @@ examples: |-

### Commit a container with new `CMD` and `EXPOSE` instructions

```bash
```console
$ docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Expand Down
8 changes: 4 additions & 4 deletions _data/engine-cli/docker_config_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ options:
examples: |-
### Create a config

```bash
```console
$ printf <config> | docker config create my_config -

onakdyv307se2tl7nl20anokv
Expand All @@ -49,7 +49,7 @@ examples: |-

### Create a config with a file

```bash
```console
$ docker config create my_config ./config.json

dg426haahpi5ezmkkj5kyl3sn
Expand All @@ -62,7 +62,7 @@ examples: |-

### Create a config with labels

```bash
```console
$ docker config create \
--label env=dev \
--label rev=20170324 \
Expand All @@ -71,7 +71,7 @@ examples: |-
eo7jnzguqgtpdah3cm5srfb97
```

```bash
```console
$ docker config inspect my_config

[
Expand Down
6 changes: 3 additions & 3 deletions _data/engine-cli/docker_config_inspect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ examples: |-

For example, given the following config:

```bash
```console
$ docker config ls

ID NAME CREATED UPDATED
eo7jnzguqgtpdah3cm5srfb97 my_config 3 minutes ago 3 minutes ago
```

```bash
```console
$ docker config inspect config.json
```

Expand Down Expand Up @@ -86,7 +86,7 @@ examples: |-
config. The following example command outputs the creation time of the
config.

```bash
```console
$ docker config inspect --format='{{.CreatedAt}}' eo7jnzguqgtpdah3cm5srfb97

2017-03-24 08:15:09.735271783 +0000 UTC
Expand Down
Loading