Merge pull request #13864 from docker/master

Publish updates from master
This commit is contained in:
Usha Mandya 2021-11-19 18:05:02 +00:00 committed by GitHub
commit 9bde392156
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 30 additions and 14 deletions

View File

@ -78,7 +78,7 @@ Make sure you have [installed `oh-my-zsh`](https://ohmyz.sh/) on your computer.
Add `docker` and `docker-compose` to the plugins list in `~/.zshrc` to run Add `docker` and `docker-compose` to the plugins list in `~/.zshrc` to run
autocompletion within the oh-my-zsh shell. In the following example, `...` autocompletion within the oh-my-zsh shell. In the following example, `...`
represent other Zsh plugins you may have installed. After that, type `source ~/.zshrc` to bring the changes. represent other Zsh plugins you may have installed. After that, type `source ~/.zshrc` to bring the changes.
To test whether it is successful, type `docker ps + tab`. To test whether it is successful, type `docker ps` and then press the **Tab** key.
```shell ```shell
plugins=(... docker docker-compose) plugins=(... docker docker-compose)

View File

@ -77,7 +77,7 @@ Most of these options take a positive integer, followed by a suffix of `b`, `k`,
| Option | Description | | Option | Description |
|:-----------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |:-----------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `-m` or `--memory=` | The maximum amount of memory the container can use. If you set this option, the minimum allowed value is `6m` (6 megabyte). | | `-m` or `--memory=` | The maximum amount of memory the container can use. If you set this option, the minimum allowed value is `6m` (6 megabytes). That is, you must set the value to at least 6 megabytes. |
| `--memory-swap`* | The amount of memory this container is allowed to swap to disk. See [`--memory-swap` details](#--memory-swap-details). | | `--memory-swap`* | The amount of memory this container is allowed to swap to disk. See [`--memory-swap` details](#--memory-swap-details). |
| `--memory-swappiness` | By default, the host kernel can swap out a percentage of anonymous pages used by a container. You can set `--memory-swappiness` to a value between 0 and 100, to tune this percentage. See [`--memory-swappiness` details](#--memory-swappiness-details). | | `--memory-swappiness` | By default, the host kernel can swap out a percentage of anonymous pages used by a container. You can set `--memory-swappiness` to a value between 0 and 100, to tune this percentage. See [`--memory-swappiness` details](#--memory-swappiness-details). |
| `--memory-reservation` | Allows you to specify a soft limit smaller than `--memory` which is activated when Docker detects contention or low memory on the host machine. If you use `--memory-reservation`, it must be set lower than `--memory` for it to take precedence. Because it is a soft limit, it does not guarantee that the container doesn't exceed the limit. | | `--memory-reservation` | Allows you to specify a soft limit smaller than `--memory` which is activated when Docker detects contention or low memory on the host machine. If you use `--memory-reservation`, it must be set lower than `--memory` for it to take precedence. Because it is a soft limit, it does not guarantee that the container doesn't exceed the limit. |

View File

@ -153,7 +153,7 @@ If you wish to set the proxy settings for your containers, you need to define
environment variables for them, just like you would do on Linux, for example: environment variables for them, just like you would do on Linux, for example:
```ps ```ps
> docker run -e HTTP_PROXY=https://proxy.example.com:3128 alpine env > docker run -e HTTP_PROXY=http://proxy.example.com:3128 alpine env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=b7edf988b2b5 HOSTNAME=b7edf988b2b5

View File

@ -25,8 +25,8 @@ Additionally, with WSL 2, the time required to start a Docker daemon after a col
Before you install the Docker Desktop WSL 2 backend, you must complete the following steps: Before you install the Docker Desktop WSL 2 backend, you must complete the following steps:
1. Install Windows 10, version 1903 or higher or Windows 11. 1. Install Windows 10, version 1903 or higher or Windows 11.
2. Enable WSL 2 feature on Windows. For detailed instructions, refer to the [Microsoft documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10). 2. Enable WSL 2 feature on Windows. For detailed instructions, refer to the [Microsoft documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10){:target="_blank" rel="noopener" class="_"}.
3. Download and install the [Linux kernel update package](https://docs.microsoft.com/windows/wsl/wsl2-kernel). 3. Download and install the [Linux kernel update package](https://docs.microsoft.com/windows/wsl/wsl2-kernel){:target="_blank" rel="noopener" class="_"}.
## Best practices ## Best practices
@ -39,13 +39,13 @@ Before you install the Docker Desktop WSL 2 backend, you must complete the follo
`docker run -v /mnt/c/users:/users` (where `/mnt/c` is mounted from Windows). `docker run -v /mnt/c/users:/users` (where `/mnt/c` is mounted from Windows).
- Instead, from a Linux shell use a command like `docker run -v ~/my-project:/sources <my-image>` - Instead, from a Linux shell use a command like `docker run -v ~/my-project:/sources <my-image>`
where `~` is expanded by the Linux shell to `$HOME`. where `~` is expanded by the Linux shell to `$HOME`.
- If you have concerns about the size of the docker-desktop-data VHDX, or need to change it, take a look at the [WSL tooling built into Windows](https://docs.microsoft.com/en-us/windows/wsl/wsl2-ux-changes#understanding-wsl-2-uses-a-vhd-and-what-to-do-if-you-reach-its-max-size). - If you have concerns about the size of the docker-desktop-data VHDX, or need to change it, take a look at the [WSL tooling built into Windows](https://docs.microsoft.com/en-us/windows/wsl/vhd-size){:target="_blank" rel="noopener" class="_"}.
- If you have concerns about CPU or memory usage, you can configure limits on the memory, CPU, Swap size allocated to the [WSL 2 utility VM](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig). - If you have concerns about CPU or memory usage, you can configure limits on the memory, CPU, Swap size allocated to the [WSL 2 utility VM](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#global-configuration-options-with-wslconfig){:target="_blank" rel="noopener" class="_"}.
- To avoid any potential conflicts with using WSL 2 on Docker Desktop, you must [uninstall any previous versions of Docker Engine](../../engine/install/ubuntu.md#uninstall-docker-engine) and CLI installed directly through Linux distributions before installing Docker Desktop. - To avoid any potential conflicts with using WSL 2 on Docker Desktop, you must [uninstall any previous versions of Docker Engine](../../engine/install/ubuntu.md#uninstall-docker-engine) and CLI installed directly through Linux distributions before installing Docker Desktop.
## Download ## Download
Download [Docker Desktop Stable 2.3.0.2](https://hub.docker.com/editions/community/docker-ce-desktop-windows/) or a later release. Download [Docker Desktop 2.3.0.2](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe) or a later release.
## Install ## Install
@ -150,4 +150,4 @@ GPU Device 0: "GeForce RTX 2060 with Max-Q Design" with compute capability 7.5
## Feedback ## Feedback
Your feedback is very important to us. Please let us know your feedback by creating an issue in the [Docker Desktop for Windows GitHub](https://github.com/docker/for-win/issues) repository and adding the **WSL 2** label. Your feedback is very important to us. Please let us know your feedback by creating an issue in the [Docker Desktop for Windows GitHub](https://github.com/docker/for-win/issues){:target="_blank" rel="noopener" class="_"} repository and adding the **WSL 2** label.

View File

@ -134,7 +134,12 @@ Now that you've run a container, what _is_ a container? Simply put, a container
a sandboxed process on your machine that is isolated from all other processes a sandboxed process on your machine that is isolated from all other processes
on the host machine. That isolation leverages [kernel namespaces and cgroups](https://medium.com/@saschagrunert/demystifying-containers-part-i-kernel-space-2c53d6979504), on the host machine. That isolation leverages [kernel namespaces and cgroups](https://medium.com/@saschagrunert/demystifying-containers-part-i-kernel-space-2c53d6979504),
features that have been in Linux for a long time. Docker has worked to make these features that have been in Linux for a long time. Docker has worked to make these
capabilities approachable and easy to use. capabilities approachable and easy to use. To summarize, a container:
- is a runnable instance of an image. You can create, start, stop, move, or delete a container using the DockerAPI or CLI.
- can be run on local machines, virtual machines or deployed to the cloud.
- is portable (can be run on any OS)
- Containers are isolated from each other and run their own software, binaries, and configurations.
> **Creating containers from scratch** > **Creating containers from scratch**
> >

View File

@ -99,6 +99,10 @@ with Docker. When you use commands such as `docker run`, the client sends these
commands to `dockerd`, which carries them out. The `docker` command uses the commands to `dockerd`, which carries them out. The `docker` command uses the
Docker API. The Docker client can communicate with more than one daemon. Docker API. The Docker client can communicate with more than one daemon.
### Docker Desktop
Docker Desktop is an easy-to-install application for your Mac or Windows environment that enables you to build and share containerized applications and microservices. Docker Desktop includes the Docker daemon (`dockerd`), the Docker client (`docker`), Docker Compose, Docker Content Trust, Kubernetes, and Credential Helper. For more information, see [Docker Desktop](../desktop/index.md).
### Docker registries ### Docker registries
A Docker _registry_ stores Docker images. Docker Hub is a public A Docker _registry_ stores Docker images. Docker Hub is a public

View File

@ -130,7 +130,14 @@ WORKDIR /app
Usually the very first thing you do once youve downloaded a project written in Node.js is to install npm packages. This ensures that your application has all its dependencies installed into the `node_modules` directory where the Node runtime will be able to find them. Usually the very first thing you do once youve downloaded a project written in Node.js is to install npm packages. This ensures that your application has all its dependencies installed into the `node_modules` directory where the Node runtime will be able to find them.
Before we can run `npm install`, we need to get our `package.json` and `package-lock.json` files into our images. We use the `COPY` command to do this. The `COPY` command takes two parameters. The first parameter tells Docker what file(s) you would like to copy into the image. The second parameter tells Docker where you want that file(s) to be copied to. Well copy the `package.json` and `package-lock.json` file into our working directory `/app`. Before we can run `npm install`, we need to get our `package.json` and `package-lock.json` files into our images. We use the `COPY` command to do this. The `COPY` command takes two parameters: `src` and `dest`. The first parameter `src` tells Docker what file(s) you would like to copy into the image. The second parameter `dest` tells Docker where you want that file(s) to be copied to. For example:
```dockerfile
COPY ["<src>", "<dest>"]
```
You can specify multiple `src` resources seperated by a comma. For example, `COPY ["<src1>", "<src2>",..., "<dest>"]`.
Well copy the `package.json` and the `package-lock.json` file into our working directory `/app`.
```dockerfile ```dockerfile
COPY ["package.json", "package-lock.json*", "./"] COPY ["package.json", "package-lock.json*", "./"]

View File

@ -72,7 +72,7 @@ This is more secure than the insecure registry solution.
-x509 -days 365 -out certs/domain.crt -x509 -days 365 -out certs/domain.crt
``` ```
Be sure to use the name `myregistrydomain.com` as a CN. Be sure to use the name `myregistry.domain.com` as a CN.
2. Use the result to [start your registry with TLS enabled](./deploying.md#get-a-certificate). 2. Use the result to [start your registry with TLS enabled](./deploying.md#get-a-certificate).

View File

@ -519,7 +519,7 @@ Notice the `addr` option is required if using a hostname instead of an IP so doc
Volumes are useful for backups, restores, and migrations. Use the Volumes are useful for backups, restores, and migrations. Use the
`--volumes-from` flag to create a new container that mounts that volume. `--volumes-from` flag to create a new container that mounts that volume.
### Backup a container ### Back up a volume
For example, create a new container named `dbstore`: For example, create a new container named `dbstore`:
@ -540,7 +540,7 @@ $ docker run --rm --volumes-from dbstore -v $(pwd):/backup ubuntu tar cvf /backu
When the command completes and the container stops, we are left with a backup of When the command completes and the container stops, we are left with a backup of
our `dbdata` volume. our `dbdata` volume.
### Restore container from backup ### Restore volume from backup
With the backup just created, you can restore it to the same container, or With the backup just created, you can restore it to the same container, or
another that you made elsewhere. another that you made elsewhere.