Merge pull request #14527 from docker/master

Publish updates from master
This commit is contained in:
Sebastiaan van Stijn 2022-04-12 13:44:29 +02:00 committed by GitHub
commit 411f53bd24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 42 additions and 38 deletions

View File

@ -17,7 +17,7 @@ Docker command-line client. If you're using `docker-machine`, then the `eval "$(
Sets the project name. This value is prepended along with the service name to Sets the project name. This value is prepended along with the service name to
the container on start up. For example, if your project name is `myapp` and it the container on start up. For example, if your project name is `myapp` and it
includes two services `db` and `web`, then Compose starts containers named includes two services `db` and `web`, then Compose starts containers named
`myapp_db_1` and `myapp_web_1` respectively. `myapp-db-1` and `myapp-web-1` respectively.
Setting this is optional. If you do not set this, the `COMPOSE_PROJECT_NAME` Setting this is optional. If you do not set this, the `COMPOSE_PROJECT_NAME`
defaults to the `basename` of the project directory. See also the `-p` defaults to the `basename` of the project directory. See also the `-p`

View File

@ -87,8 +87,8 @@ fi
</div> </div>
</div> </div>
1. Click **Create New Environment**. This opens the **Create a Dev Environment** dialog. Copy `https://github.com/dockersamples/single-dev-env.git` and add it to the **Repository URL** field on the **Remote Git Repository** tab. 1. Under Dev Environments, click **Create**. This opens the **Create a Dev Environment** dialog. Click **Get Started** and then copy `https://github.com/dockersamples/single-dev-env.git` and add it to the **Enter the Git Repository** field on the **Existing Git repo** source.
2. Now, click **Create**. 2. Now, click **Continue**.
This clones the Git code inside a volume, determines the best image for your Dev Environment, and finally, opens VS Code inside the Dev Environment container. This clones the Git code inside a volume, determines the best image for your Dev Environment, and finally, opens VS Code inside the Dev Environment container.
@ -150,8 +150,8 @@ You can also use Dev Environments to collaborate on any Docker Compose-based pro
> >
> When cloning a Git repository using SSH, ensure you've added your SSH key to the ssh-agent. To do this, open a terminal and run `ssh-add <path to your private ssh key>`. > When cloning a Git repository using SSH, ensure you've added your SSH key to the ssh-agent. To do this, open a terminal and run `ssh-add <path to your private ssh key>`.
1. Click **Create** to open the **Create a Dev Environment** dialog. Then, copy `https://github.com/dockersamples/compose-dev-env.git` and add it to the **Docker image** field on the **Remote** tab. 1. Under Dev Environments, click **Create**. This opens the **Create a Dev Environment** dialog. Click **Get Started** and then copy `https://github.com/dockersamples/compose-dev-env.git` and add it to the **Enter the Git Repository** field on the **Existing Git repo** source.
2. Click **Create**. This initializes the project and clones the Git code and builds the Compose application. This: 2. Click **Continue**. This initializes the project and clones the Git code and builds the Compose application. This:
- Builds local images for services that are defined in the Compose file - Builds local images for services that are defined in the Compose file
- Pulls images required for other services - Pulls images required for other services

View File

@ -86,6 +86,7 @@ Take a look at the [Docker Public Roadmap](https://github.com/docker/roadmap/pro
### Security ### Security
- Fixed [CVE-2022-0847](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0847){: target="_blank" rel="noopener" class="_"}, aka “Dirty Pipe”, an issue that could enable attackers to modify files in container images on the host, from inside a container. - Fixed [CVE-2022-0847](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0847){: target="_blank" rel="noopener" class="_"}, aka “Dirty Pipe”, an issue that could enable attackers to modify files in container images on the host, from inside a container.
If using the WSL 2 backend, you must update WSL 2 by running `wsl --update`.
- Fixed [CVE-2022-26659](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-26659){: target="_blank" rel="noopener" class="_"}, which could allow an attacker to overwrite any administrator writable file on the system during the installation or the update of Docker Desktop. - Fixed [CVE-2022-26659](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-26659){: target="_blank" rel="noopener" class="_"}, which could allow an attacker to overwrite any administrator writable file on the system during the installation or the update of Docker Desktop.
### New ### New

View File

@ -15,7 +15,6 @@ A Software Bill Of Materials (SBOM) is analogous to a packing list for a shipmen
The experimental `docker sbom` command allows you to generate the SBOM of a container image. Today, it does this by scanning the layers of the image using the [Syft project](https://github.com/anchore/syft) but in future it may read the SBOM from the image itself or elsewhere. The experimental `docker sbom` command allows you to generate the SBOM of a container image. Today, it does this by scanning the layers of the image using the [Syft project](https://github.com/anchore/syft) but in future it may read the SBOM from the image itself or elsewhere.
## Simple use ## Simple use
To output a tabulated SBOM for an image, use `docker sbom <image>:<tag>`: To output a tabulated SBOM for an image, use `docker sbom <image>:<tag>`:
@ -90,8 +89,9 @@ $ cat sbom.json
"spdxVersion": "SPDX-2.2", "spdxVersion": "SPDX-2.2",
... ...
} }
```
## Feedback ## Feedback
Thanks for trying the Docker SBOM CLI plugin. Wed love to hear from you. You can provide feedback and report any bugs through the Issues tracker in the [docker/[sbom-cli-plugin](https://github.com/docker/sbom-cli-plugin){: target="_blank" rel="noopener" class="_"} GitHub repository. Thanks for trying the Docker SBOM CLI plugin. Wed love to hear from you. You can provide feedback and report any bugs through the Issues tracker in the
[docker/sbom-cli-plugin](https://github.com/docker/sbom-cli-plugin){: target="_blank" rel="noopener" class="_"} GitHub repository.

View File

@ -330,7 +330,7 @@ services which publish ports, such as a WordPress service which publishes port
--ingress \ --ingress \
--subnet=10.11.0.0/16 \ --subnet=10.11.0.0/16 \
--gateway=10.11.0.2 \ --gateway=10.11.0.2 \
--opt com.docker.network.mtu=1200 \ --opt com.docker.network.driver.mtu=1200 \
my-ingress my-ingress
``` ```

View File

@ -45,7 +45,7 @@ you can delete the service from the swarm.
688172d3bfaa alpine:latest "ping docker.com" 45 minutes ago Up About a minute helloworld.1.74nbhb3fhud8jfrhigd7s29we 688172d3bfaa alpine:latest "ping docker.com" 45 minutes ago Up About a minute helloworld.1.74nbhb3fhud8jfrhigd7s29we
$ docker ps $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
``` ```

View File

@ -43,7 +43,7 @@ Docker Desktop will set up Kubernetes for you quickly and easily. Follow the set
spec: spec:
containers: containers:
- name: testpod - name: testpod
image: alpine:3.5 image: alpine:latest
command: ["ping", "8.8.8.8"] command: ["ping", "8.8.8.8"]
``` ```
@ -113,7 +113,7 @@ Docker Desktop will set up Kubernetes for you quickly and easily. Follow the set
spec: spec:
containers: containers:
- name: testpod - name: testpod
image: alpine:3.5 image: alpine:latest
command: ["ping", "8.8.8.8"] command: ["ping", "8.8.8.8"]
``` ```
@ -201,7 +201,7 @@ Docker Desktop runs primarily on Docker Engine, which has everything you need to
2. Run a simple Docker service that uses an alpine-based filesystem, and isolates a ping to 8.8.8.8: 2. Run a simple Docker service that uses an alpine-based filesystem, and isolates a ping to 8.8.8.8:
```console ```console
$ docker service create --name demo alpine:3.5 ping 8.8.8.8 $ docker service create --name demo alpine:latest ping 8.8.8.8
``` ```
3. Check that your service created one running container: 3. Check that your service created one running container:
@ -214,7 +214,7 @@ Docker Desktop runs primarily on Docker Engine, which has everything you need to
```shell ```shell
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
463j2s3y4b5o demo.1 alpine:3.5 docker-desktop Running Running 8 seconds ago 463j2s3y4b5o demo.1 alpine:latest docker-desktop Running Running 8 seconds ago
``` ```
4. Check that you get the logs you'd expect for a ping process: 4. Check that you get the logs you'd expect for a ping process:
@ -269,7 +269,7 @@ Docker Desktop runs primarily on Docker Engine, which has everything you need to
2. Run a simple Docker service that uses an alpine-based filesystem, and isolates a ping to 8.8.8.8: 2. Run a simple Docker service that uses an alpine-based filesystem, and isolates a ping to 8.8.8.8:
```console ```console
$ docker service create --name demo alpine:3.5 ping 8.8.8.8 $ docker service create --name demo alpine:latest ping 8.8.8.8
``` ```
3. Check that your service created one running container: 3. Check that your service created one running container:
@ -282,7 +282,7 @@ Docker Desktop runs primarily on Docker Engine, which has everything you need to
```shell ```shell
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
463j2s3y4b5o demo.1 alpine:3.5 docker-desktop Running Running 8 seconds ago 463j2s3y4b5o demo.1 alpine:latest docker-desktop Running Running 8 seconds ago
``` ```
4. Check that you get the logs you'd expect for a ping process: 4. Check that you get the logs you'd expect for a ping process:

View File

@ -163,7 +163,7 @@ Well use the debugger that comes with the IntelliJ IDEA. You can use the comm
Let's set a breakpoint Let's set a breakpoint
Open the following file `src/main/java/org/springframework/samples/petclinic/vet/VetController.java` and add a breakpoint inside the `showResourcesVetList` function, line 54 for example. Open the following file `src/main/java/org/springframework/samples/petclinic/vet/VetController.java` and add a breakpoint inside the `showResourcesVetList` function.
Start your debug session, **Run** menu and then **Debug _NameOfYourConfiguration_** Start your debug session, **Run** menu and then **Debug _NameOfYourConfiguration_**
@ -179,7 +179,7 @@ We can now call the server endpoint.
$ curl --request GET --url http://localhost:8080/vets $ curl --request GET --url http://localhost:8080/vets
``` ```
You should have seen the code break on line 54 and now you are able to use the debugger just like you would normally. You can also inspect and watch variables, set conditional breakpoints, view stack traces and a do bunch of other stuff. You should have seen the code break on the marked line and now you are able to use the debugger just like you would normally. You can also inspect and watch variables, set conditional breakpoints, view stack traces and a do bunch of other stuff.
![Debugger code breakpoint](images/debugger-breakpoint.png) ![Debugger code breakpoint](images/debugger-breakpoint.png)

View File

@ -16,7 +16,7 @@ Testing is an essential part of modern software development. Testing can mean a
## Refactor Dockerfile to run tests ## Refactor Dockerfile to run tests
The **Spring Pet Clinic** source code has already tests defined in the test directory `src/test/java/org/springframework/samples/petclinic`. You just need to update the JaCoCo version in your `pom.xml` to ensure your tests work with JDK v15 or higher with `<jacoco.version>0.8.6</jacoco.version>`, so we can use the following Docker command to start the container and run tests: The **Spring Pet Clinic** source code has already tests defined in the test directory `src/test/java/org/springframework/samples/petclinic`. We can use the following Docker command to start the container and run tests:
```console ```console
$ docker run -it --rm --name springboot-test java-docker ./mvnw test $ docker run -it --rm --name springboot-test java-docker ./mvnw test
@ -149,13 +149,16 @@ $ docker build -t java-docker --target test .
The build output is truncated for simplicity, but you can see that our tests ran succesfully and passed. Lets break one of the tests and observe the output when our tests fail. The build output is truncated for simplicity, but you can see that our tests ran succesfully and passed. Lets break one of the tests and observe the output when our tests fail.
Open the `src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java` file and change **line 57** to the following. Open the `src/test/java/org/springframework/samples/petclinic/model/ValidatorTests.java` file and change the assertion
```shell ```java
55 ConstraintViolation<Person> violation = constraintViolations.iterator().next(); assertThat(violation.getMessage()).isEqualTo("must not be empty");
56 assertThat(violation.getPropertyPath().toString()).isEqualTo("firstName"); ```
57 assertThat(violation.getMessage()).isEqualTo("must be empty");
58 } with the following.
```java
assertThat(violation.getMessage()).isEqualTo("must be empty");
``` ```
Now, run the `docker build` command from above and observe that the build fails and the failing testing information is printed to the console. Now, run the `docker build` command from above and observe that the build fails and the failing testing information is printed to the console.

View File

@ -52,14 +52,14 @@ If you want to understand, you should read [How to Write Go Code](https://golang
Copy the registry configuration file in place: Copy the registry configuration file in place:
mkdir /Users/Shared/Registry mkdir /Users/Shared/Registry
cp docs/osx/config.yml /Users/Shared/Registry/config.yml cp docs/recipes/osx/config.yml /Users/Shared/Registry/config.yml
## Run the Docker Registry under launchd ## Run the Docker Registry under launchd
Copy the Docker registry plist into place: Copy the Docker registry plist into place:
plutil -lint registry/recipes/osx/com.docker.registry.plist plutil -lint docs/recipes/osx/com.docker.registry.plist
cp registry/recipes/osx/com.docker.registry.plist ~/Library/LaunchAgents/ cp docs/recipes/osx/com.docker.registry.plist ~/Library/LaunchAgents/
chmod 644 ~/Library/LaunchAgents/com.docker.registry.plist chmod 644 ~/Library/LaunchAgents/com.docker.registry.plist
Start the Docker registry: Start the Docker registry: