From c55df2d39bcd65a1decdfc923a9a6f0360f27da8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 6 Aug 2021 17:14:37 +0200 Subject: [PATCH] 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 --- docker-for-mac/apple-silicon.md | 4 ++-- docker-for-mac/index.md | 20 ++++++++--------- docker-for-mac/install.md | 4 ++-- docker-for-mac/networking.md | 6 ++--- docker-for-mac/space.md | 8 +++---- docker-for-mac/troubleshoot.md | 39 +++++++++++++++++---------------- 6 files changed, 41 insertions(+), 40 deletions(-) diff --git a/docker-for-mac/apple-silicon.md b/docker-for-mac/apple-silicon.md index 28d1ad6d29..6e0390e0c8 100644 --- a/docker-for-mac/apple-silicon.md +++ b/docker-for-mac/apple-silicon.md @@ -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: -```shell -softwareupdate --install-rosetta +```console +$ softwareupdate --install-rosetta ``` We expect to fix this in a future release. diff --git a/docker-for-mac/index.md b/docker-for-mac/index.md index 97e781c849..8b7d2adadf 100644 --- a/docker-for-mac/index.md +++ b/docker-for-mac/index.md @@ -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 here. (If `false`, Experimental mode is off.) -```bash -> docker version +```console +$ docker version Client: Docker Engine - Community 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 an example: -```bash +```console $ 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`: -```shell +```bash [ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion ``` OR -```shell +```bash if [ -f $(brew --prefix)/etc/bash_completion ]; then . $(brew --prefix)/etc/bash_completion fi @@ -383,15 +383,15 @@ directory. Create the `completions` directory: -```bash -mkdir -p ~/.config/fish/completions +```console +$ mkdir -p ~/.config/fish/completions ``` Now add fish completions from docker. -```bash -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 +```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-compose.fish-completion ~/.config/fish/completions/docker-compose.fish ``` ## Give feedback and get help diff --git a/docker-for-mac/install.md b/docker-for-mac/install.md index 44313d0f1b..50b1118178 100644 --- a/docker-for-mac/install.md +++ b/docker-for-mac/install.md @@ -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: - ```bash - softwareupdate --install-rosetta + ```console + $ softwareupdate --install-rosetta ``` For more information, see [Docker Desktop for Apple silicon](apple-silicon.md). diff --git a/docker-for-mac/networking.md b/docker-for-mac/networking.md index a1f055d081..311f416287 100644 --- a/docker-for-mac/networking.md +++ b/docker-for-mac/networking.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) is an example of this. -```bash +```console $ docker run -d -p 80:80 --name webserver nginx ``` To clarify the syntax, the following two commands both expose port `80` on the container to port `8000` on the host: -```bash +```console $ docker run --publish 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 container to random ports on the host. -```bash +```console $ docker run -d -P --name webserver nginx ``` diff --git a/docker-for-mac/space.md b/docker-for-mac/space.md index 1005b9b742..aae3422474 100644 --- a/docker-for-mac/space.md +++ b/docker-for-mac/space.md @@ -45,19 +45,19 @@ docker system df -v Alternatively, to list images, run: -```bash +```console $ docker image ls ``` and then, to list containers, run: -```bash +```console $ docker container ls -a ``` If there are lots of redundant objects, run the command: -```bash +```console $ 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. 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 vms/0/data $ ls -klsh Docker.raw diff --git a/docker-for-mac/troubleshoot.md b/docker-for-mac/troubleshoot.md index 6e19929598..1346cd2524 100644 --- a/docker-for-mac/troubleshoot.md +++ b/docker-for-mac/troubleshoot.md @@ -40,17 +40,18 @@ system. > Uninstall Docker Desktop from the command line > ->To uninstall Docker Desktop from a terminal, run: ` ->--uninstall`. If your instance is installed in the default location, this ->command provides a clean uninstall: +> To uninstall Docker Desktop from a terminal, run: ` +> --uninstall`. If your instance is installed in the default location, this +> command provides a clean uninstall: > ->```shell ->$ /Applications/Docker.app/Contents/MacOS/Docker --uninstall ->Docker is running, exiting... ->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. +> ```console +> $ /Applications/Docker.app/Contents/MacOS/Docker --uninstall +> Docker is running, exiting... +> 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. ## 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 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. @@ -90,7 +91,7 @@ First, locate the `com.docker.diagnose` tool. If you have installed Docker Desk To create *and upload* diagnostics, run: -```sh +```console $ /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: -```sh +```console $ 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. -```bash +```console $ pred='process matches ".*(ocker|vpnkit).*" || (process in {"taskgated-helper", "launchservicesd", "kernel"} && eventMessage contains[c] "docker")' $ /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: -``` +```console $ /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. -```bash -sysctl kern.hv_support +```console +$ sysctl kern.hv_support ``` 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 instances through Unix sockets. For example: - ```bash - export DOCKER_HOST=unix:///var/run/docker.sock + ```console + $ export DOCKER_HOST=unix:///var/run/docker.sock ``` * There are a number of issues with the performance of directories bind-mounted