From a74fc9a9c40fca0f2bbe5645b36126796e122d1a Mon Sep 17 00:00:00 2001 From: fazchow Date: Sun, 16 May 2021 07:47:14 +0200 Subject: [PATCH 1/4] Update django.md Added data folder that is created and the fact that we should not change its permission from root was made more explicit. --- samples/django.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/django.md b/samples/django.md index bc260b9a86..c25dd841cb 100644 --- a/samples/django.md +++ b/samples/django.md @@ -128,6 +128,7 @@ In this step, you create a Django starter project by building the image from the $ ls -l drwxr-xr-x 2 root root composeexample + drwxr-xr-x 3 root root data -rw-rw-r-- 1 user user docker-compose.yml -rw-rw-r-- 1 user user Dockerfile -rwxr-xr-x 1 root root manage.py @@ -137,9 +138,11 @@ In this step, you create a Django starter project by building the image from the If you are running Docker on Linux, the files `django-admin` created are owned by root. This happens because the container runs as the root user. Change the ownership of the new files. + + Do not change the permission of the data folder where Postgres has its file, otherwise Postgres will not be able to start due to permission issues. ```console - $ sudo chown -R $USER:$USER . + $ sudo chown -R $USER:$USER composeexample manage.py ``` If you are running Docker on Mac or Windows, you should already From 75adef65ddf2547319451495e1ca3b8a4ce174a9 Mon Sep 17 00:00:00 2001 From: Carlos H Brandt Date: Fri, 22 Apr 2022 12:42:21 +0200 Subject: [PATCH 2/4] Add link to Dockerfile/build reference (#12579) * Add link to Dockerfile/build reference This fixes #12578 * Update develop/index.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- develop/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/develop/index.md b/develop/index.md index 0e271b1ebe..bdde70f6d4 100644 --- a/develop/index.md +++ b/develop/index.md @@ -16,6 +16,7 @@ If you're just getting started developing a brand new app on Docker, check out these resources to understand some of the most common patterns for getting the most benefits from Docker. +- Learn how to [build an image](../engine/reference/builder/){: target="_blank" rel="noopener" class="_"} using a Dockerfile - Use [multi-stage builds](develop-images/multistage-build.md){: target="_blank" rel="noopener" class="_"} to keep your images lean - Manage application data using [volumes](../storage/volumes.md) and [bind mounts](../storage/bind-mounts.md){: target="_blank" rel="noopener" class="_"} - [Scale your app with Kubernetes](../get-started/kube-deploy.md){: target="_blank" rel="noopener" class="_"} From ab445f493ec18e88cbe235564e17df0191719e7a Mon Sep 17 00:00:00 2001 From: Nikhil Sharma Date: Fri, 22 Apr 2022 16:24:28 +0530 Subject: [PATCH 3/4] Update bind-mounts.md (#14355) * Update bind-mounts.md * Apply suggestions from code review * Update storage/bind-mounts.md Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> --- storage/bind-mounts.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/bind-mounts.md b/storage/bind-mounts.md index 013cf81e1c..d0de1010f0 100644 --- a/storage/bind-mounts.md +++ b/storage/bind-mounts.md @@ -289,6 +289,11 @@ propagation setting has a recursive counterpoint. In the case of recursion, consider that `/tmp/a` is also mounted as `/foo`. The propagation settings control whether `/mnt/a` and/or `/tmp/a` would exist. +> **Warning:** +> +> Mount propagation doesn't work with Docker Desktop. +{: .warning + | Propagation setting | Description | |:--------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `shared` | Sub-mounts of the original mount are exposed to replica mounts, and sub-mounts of replica mounts are also propagated to the original mount. | From 6a45693de1575cfea0367e69ae39fad68b6dc332 Mon Sep 17 00:00:00 2001 From: David Scott Date: Fri, 22 Apr 2022 17:54:01 +0100 Subject: [PATCH 4/4] Desktop: improve enable kubernetes section (#14593) * desktop: no need to mention "in a docker container" for k8s It's an implementation detail. Signed-off-by: David Scott * desktop: `docker ps` rather than `docker service ls` `docker service ls` is a Swarm API. We could use `docker container ls` but to be honest everyone prefers `docker ps` since it's shorter. Signed-off-by: David Scott * desktop: move the option that no-one needs after the screenshot We want to emphasize how easy it is to enable and avoid telling people about advanced features which they don't need up front. Signed-off-by: David Scott * desktop: the section on kubectl is not a pre-req It's not possible to use the docker-desktop kubernetes context because it hasn't been created yet. Signed-off-by: David Scott * desktop: merge the kubectl sections Signed-off-by: David Scott --- desktop/kubernetes.md | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/desktop/kubernetes.md b/desktop/kubernetes.md index c50cf663da..2144cce49b 100644 --- a/desktop/kubernetes.md +++ b/desktop/kubernetes.md @@ -15,32 +15,16 @@ is only for local testing. Enabling Kubernetes allows you to deploy your workloads in parallel, on Kubernetes, Swarm, and as standalone containers. Enabling or disabling the Kubernetes server does not affect your other workloads. -## Prerequisites - -The Kubernetes client command `kubectl` is included and configured to connect -to the local Kubernetes server. If you have already installed `kubectl` and -pointing to some other environment, such as `minikube` or a GKE cluster, ensure you change the context so that `kubectl` is pointing to `docker-desktop`: - -```console -$ kubectl config get-contexts -$ kubectl config use-context docker-desktop -``` - -If you installed `kubectl` using Homebrew, or by some other method, and -experience conflicts, remove `/usr/local/bin/kubectl`. - ## Enable Kubernetes -To enable Kubernetes support and install a standalone instance of Kubernetes -running as a Docker container, go to **Preferences** > **Kubernetes** and then click **Enable Kubernetes**. - -By default, Kubernetes containers are hidden from commands like `docker -service ls`, because managing them manually is not supported. To see these internal containers, select **Show system containers (advanced)**. Most users do not need this option. +To enable Kubernetes in Docker Desktop, go to **Preferences** > **Kubernetes** and then click **Enable Kubernetes**. Click **Apply & Restart** to save the settings and then click **Install** to confirm. This instantiates images required to run the Kubernetes server as containers, and installs the `/usr/local/bin/kubectl` command on your machine. ![Enable Kubernetes](images/kube-enable.png){:width="750px"} +By default, Kubernetes containers are hidden from commands like `docker ps`, because managing them manually is not supported. To see these internal containers, select **Show system containers (advanced)**. Most users do not need this option. + When Kubernetes is enabled and running, an additional status bar item displays at the bottom right of the Docker Desktop Settings dialog. @@ -60,6 +44,17 @@ at `/usr/local/bin/kubectl` on Mac and at `C:\>Program Files\Docker\Docker\Resou variable, so you may need to type the full path of the command or add it to the `PATH`. +If you have already installed `kubectl` and +pointing to some other environment, such as `minikube` or a GKE cluster, ensure you change the context so that `kubectl` is pointing to `docker-desktop`: + +```console +$ kubectl config get-contexts +$ kubectl config use-context docker-desktop +``` + +If you installed `kubectl` using Homebrew, or by some other method, and +experience conflicts, remove `/usr/local/bin/kubectl`. + You can test the command by listing the available nodes: ```console