mirror of https://github.com/docker/docs.git
docker-for-mac: use "console" for shell examples
This allows for easier copying of the commands, without selecting the prompt. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
fbfa187a83
commit
c55df2d39b
|
@ -24,8 +24,8 @@ Download Docker Desktop for Mac on Apple silicon:
|
||||||
|
|
||||||
You must install **Rosetta 2** as some binaries are still Darwin/AMD64. To install Rosetta 2 manually from the command line, run the following command:
|
You must install **Rosetta 2** as some binaries are still Darwin/AMD64. To install Rosetta 2 manually from the command line, run the following command:
|
||||||
|
|
||||||
```shell
|
```console
|
||||||
softwareupdate --install-rosetta
|
$ softwareupdate --install-rosetta
|
||||||
```
|
```
|
||||||
|
|
||||||
We expect to fix this in a future release.
|
We expect to fix this in a future release.
|
||||||
|
|
|
@ -175,8 +175,8 @@ You can see whether you are running experimental mode at the command line. If
|
||||||
`Experimental` is `true`, then Docker is running in experimental mode, as shown
|
`Experimental` is `true`, then Docker is running in experimental mode, as shown
|
||||||
here. (If `false`, Experimental mode is off.)
|
here. (If `false`, Experimental mode is off.)
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
> docker version
|
$ docker version
|
||||||
|
|
||||||
Client: Docker Engine - Community
|
Client: Docker Engine - Community
|
||||||
Version: 19.03.1
|
Version: 19.03.1
|
||||||
|
@ -243,7 +243,7 @@ To manually add a custom, self-signed certificate, start by adding the
|
||||||
certificate to the macOS keychain, which is picked up by Docker Desktop. Here is
|
certificate to the macOS keychain, which is picked up by Docker Desktop. Here is
|
||||||
an example:
|
an example:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.crt
|
$ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.crt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -347,13 +347,13 @@ ln -s $etc/docker-compose.bash-completion $(brew --prefix)/etc/bash_completion.d
|
||||||
|
|
||||||
Add the following to your `~/.bash_profile`:
|
Add the following to your `~/.bash_profile`:
|
||||||
|
|
||||||
```shell
|
```bash
|
||||||
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
|
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
|
||||||
```
|
```
|
||||||
|
|
||||||
OR
|
OR
|
||||||
|
|
||||||
```shell
|
```bash
|
||||||
if [ -f $(brew --prefix)/etc/bash_completion ]; then
|
if [ -f $(brew --prefix)/etc/bash_completion ]; then
|
||||||
. $(brew --prefix)/etc/bash_completion
|
. $(brew --prefix)/etc/bash_completion
|
||||||
fi
|
fi
|
||||||
|
@ -383,15 +383,15 @@ directory.
|
||||||
|
|
||||||
Create the `completions` directory:
|
Create the `completions` directory:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
mkdir -p ~/.config/fish/completions
|
$ mkdir -p ~/.config/fish/completions
|
||||||
```
|
```
|
||||||
|
|
||||||
Now add fish completions from docker.
|
Now add fish completions from docker.
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
ln -shi /Applications/Docker.app/Contents/Resources/etc/docker.fish-completion ~/.config/fish/completions/docker.fish
|
$ ln -shi /Applications/Docker.app/Contents/Resources/etc/docker.fish-completion ~/.config/fish/completions/docker.fish
|
||||||
ln -shi /Applications/Docker.app/Contents/Resources/etc/docker-compose.fish-completion ~/.config/fish/completions/docker-compose.fish
|
$ ln -shi /Applications/Docker.app/Contents/Resources/etc/docker-compose.fish-completion ~/.config/fish/completions/docker-compose.fish
|
||||||
```
|
```
|
||||||
|
|
||||||
## Give feedback and get help
|
## Give feedback and get help
|
||||||
|
|
|
@ -45,8 +45,8 @@ Your Mac must meet the following requirements to successfully install Docker Des
|
||||||
|
|
||||||
- You must install **Rosetta 2** as some binaries are still Darwin/AMD64. To install Rosetta 2 manually from the command line, run the following command:
|
- You must install **Rosetta 2** as some binaries are still Darwin/AMD64. To install Rosetta 2 manually from the command line, run the following command:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
softwareupdate --install-rosetta
|
$ softwareupdate --install-rosetta
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information, see [Docker Desktop for Apple silicon](apple-silicon.md).
|
For more information, see [Docker Desktop for Apple silicon](apple-silicon.md).
|
||||||
|
|
|
@ -109,14 +109,14 @@ overlay network, not a bridge network, as these are not routed.
|
||||||
The command to run the `nginx` webserver shown in [Getting Started](index.md#explore-the-application)
|
The command to run the `nginx` webserver shown in [Getting Started](index.md#explore-the-application)
|
||||||
is an example of this.
|
is an example of this.
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ docker run -d -p 80:80 --name webserver nginx
|
$ docker run -d -p 80:80 --name webserver nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
To clarify the syntax, the following two commands both expose port `80` on the
|
To clarify the syntax, the following two commands both expose port `80` on the
|
||||||
container to port `8000` on the host:
|
container to port `8000` on the host:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ docker run --publish 8000:80 --name webserver nginx
|
$ docker run --publish 8000:80 --name webserver nginx
|
||||||
|
|
||||||
$ docker run -p 8000:80 --name webserver nginx
|
$ docker run -p 8000:80 --name webserver nginx
|
||||||
|
@ -126,7 +126,7 @@ To expose all ports, use the `-P` flag. For example, the following command
|
||||||
starts a container (in detached mode) and the `-P` exposes all ports on the
|
starts a container (in detached mode) and the `-P` exposes all ports on the
|
||||||
container to random ports on the host.
|
container to random ports on the host.
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ docker run -d -P --name webserver nginx
|
$ docker run -d -P --name webserver nginx
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -45,19 +45,19 @@ docker system df -v
|
||||||
|
|
||||||
Alternatively, to list images, run:
|
Alternatively, to list images, run:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ docker image ls
|
$ docker image ls
|
||||||
```
|
```
|
||||||
|
|
||||||
and then, to list containers, run:
|
and then, to list containers, run:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ docker container ls -a
|
$ docker container ls -a
|
||||||
```
|
```
|
||||||
|
|
||||||
If there are lots of redundant objects, run the command:
|
If there are lots of redundant objects, run the command:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ docker system prune
|
$ docker system prune
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ $ docker run --privileged --pid=host docker/desktop-reclaim-space
|
||||||
Note that many tools report the maximum file size, not the actual file size.
|
Note that many tools report the maximum file size, not the actual file size.
|
||||||
To query the actual size of the file on the host from a terminal, run:
|
To query the actual size of the file on the host from a terminal, run:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ cd ~/Library/Containers/com.docker.docker/Data
|
$ cd ~/Library/Containers/com.docker.docker/Data
|
||||||
$ cd vms/0/data
|
$ cd vms/0/data
|
||||||
$ ls -klsh Docker.raw
|
$ ls -klsh Docker.raw
|
||||||
|
|
|
@ -40,17 +40,18 @@ system.
|
||||||
|
|
||||||
> Uninstall Docker Desktop from the command line
|
> Uninstall Docker Desktop from the command line
|
||||||
>
|
>
|
||||||
>To uninstall Docker Desktop from a terminal, run: `<DockerforMacPath>
|
> To uninstall Docker Desktop from a terminal, run: `<DockerforMacPath>
|
||||||
>--uninstall`. If your instance is installed in the default location, this
|
> --uninstall`. If your instance is installed in the default location, this
|
||||||
>command provides a clean uninstall:
|
> command provides a clean uninstall:
|
||||||
>
|
>
|
||||||
>```shell
|
> ```console
|
||||||
>$ /Applications/Docker.app/Contents/MacOS/Docker --uninstall
|
> $ /Applications/Docker.app/Contents/MacOS/Docker --uninstall
|
||||||
>Docker is running, exiting...
|
> Docker is running, exiting...
|
||||||
>Docker uninstalled successfully. You can move the Docker application to the trash.
|
> Docker uninstalled successfully. You can move the Docker application to the trash.
|
||||||
>```
|
> ```
|
||||||
>You might want to use the command-line uninstall if, for example, you find that
|
>
|
||||||
>the app is non-functional, and you cannot uninstall it from the menu.
|
> You might want to use the command-line uninstall if, for example, you find that
|
||||||
|
> the app is non-functional, and you cannot uninstall it from the menu.
|
||||||
|
|
||||||
## Diagnose and feedback
|
## Diagnose and feedback
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ documentation, on [Docker Desktop issues on
|
||||||
GitHub](https://github.com/docker/for-mac/issues), or the [Docker Desktop forum](https://forums.docker.com/c/docker-for-mac), we can help you troubleshoot
|
GitHub](https://github.com/docker/for-mac/issues), or the [Docker Desktop forum](https://forums.docker.com/c/docker-for-mac), we can help you troubleshoot
|
||||||
the log data. Before reporting an issue, we recommend that you read the information provided on this page to fix some common known issues.
|
the log data. Before reporting an issue, we recommend that you read the information provided on this page to fix some common known issues.
|
||||||
|
|
||||||
>**Note**
|
> **Note**
|
||||||
>
|
>
|
||||||
> Docker Desktop offers support for users subscribed to a Pro or a Team plan. If you are experiencing any issues with Docker Desktop, follow the instructions in this section to send a support request to Docker Support.
|
> Docker Desktop offers support for users subscribed to a Pro or a Team plan. If you are experiencing any issues with Docker Desktop, follow the instructions in this section to send a support request to Docker Support.
|
||||||
|
|
||||||
|
@ -90,7 +91,7 @@ First, locate the `com.docker.diagnose` tool. If you have installed Docker Desk
|
||||||
|
|
||||||
To create *and upload* diagnostics, run:
|
To create *and upload* diagnostics, run:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ /Applications/Docker.app/Contents/MacOS/com.docker.diagnose gather -upload
|
$ /Applications/Docker.app/Contents/MacOS/com.docker.diagnose gather -upload
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -110,7 +111,7 @@ composed of your user ID (BE9AFAAF-F68B-41D0-9D12-84760E6B8740) and a timestamp
|
||||||
|
|
||||||
To view the contents of the diagnostic file, run:
|
To view the contents of the diagnostic file, run:
|
||||||
|
|
||||||
```sh
|
```console
|
||||||
$ open /tmp/BE9AFAAF-F68B-41D0-9D12-84760E6B8740/20190905152051.zip
|
$ open /tmp/BE9AFAAF-F68B-41D0-9D12-84760E6B8740/20190905152051.zip
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -125,7 +126,7 @@ browse the logs yourself.
|
||||||
|
|
||||||
To watch the live flow of Docker Desktop logs in the command line, run the following script from your favorite shell.
|
To watch the live flow of Docker Desktop logs in the command line, run the following script from your favorite shell.
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
$ pred='process matches ".*(ocker|vpnkit).*"
|
$ pred='process matches ".*(ocker|vpnkit).*"
|
||||||
|| (process in {"taskgated-helper", "launchservicesd", "kernel"} && eventMessage contains[c] "docker")'
|
|| (process in {"taskgated-helper", "launchservicesd", "kernel"} && eventMessage contains[c] "docker")'
|
||||||
$ /usr/bin/log stream --style syslog --level=debug --color=always --predicate "$pred"
|
$ /usr/bin/log stream --style syslog --level=debug --color=always --predicate "$pred"
|
||||||
|
@ -133,7 +134,7 @@ $ /usr/bin/log stream --style syslog --level=debug --color=always --predicate "$
|
||||||
|
|
||||||
Alternatively, to collect the last day of logs (`1d`) in a file, run:
|
Alternatively, to collect the last day of logs (`1d`) in a file, run:
|
||||||
|
|
||||||
```
|
```console
|
||||||
$ /usr/bin/log show --debug --info --style syslog --last 1d --predicate "$pred" >/tmp/logs.txt
|
$ /usr/bin/log show --debug --info --style syslog --last 1d --predicate "$pred" >/tmp/logs.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -203,8 +204,8 @@ Tables (EPT) and Unrestricted Mode are supported.*
|
||||||
|
|
||||||
To check if your Mac supports the Hypervisor framework, run the following command in a terminal window.
|
To check if your Mac supports the Hypervisor framework, run the following command in a terminal window.
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
sysctl kern.hv_support
|
$ sysctl kern.hv_support
|
||||||
```
|
```
|
||||||
|
|
||||||
If your Mac supports the Hypervisor Framework, the command prints
|
If your Mac supports the Hypervisor Framework, the command prints
|
||||||
|
@ -305,8 +306,8 @@ in the Apple documentation, and Docker Desktop [Mac system requirements](install
|
||||||
`DOCKER_CERT_PATH` environment variables, specify these to connect to Docker
|
`DOCKER_CERT_PATH` environment variables, specify these to connect to Docker
|
||||||
instances through Unix sockets. For example:
|
instances through Unix sockets. For example:
|
||||||
|
|
||||||
```bash
|
```console
|
||||||
export DOCKER_HOST=unix:///var/run/docker.sock
|
$ export DOCKER_HOST=unix:///var/run/docker.sock
|
||||||
```
|
```
|
||||||
|
|
||||||
* There are a number of issues with the performance of directories bind-mounted
|
* There are a number of issues with the performance of directories bind-mounted
|
||||||
|
|
Loading…
Reference in New Issue