diff --git a/_data/toc.yaml b/_data/toc.yaml index 204559b8f0..9b65e99fa2 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -1138,25 +1138,25 @@ samples: section: - path: /samples/ title: Samples home - - path: /engine/examples/apt-cacher-ng/ + - path: /samples/apt-cacher-ng/ title: apt-cacher-ng - - path: /engine/examples/dotnetcore/ + - path: /samples/dotnetcore/ title: ASP.NET Core application - path: /compose/aspnet-mssql-compose/ title: ASP.NET Core + SQL Server on Linux - - path: /engine/examples/couchdb_data_volumes/ + - path: /samples/couchdb_data_volumes/ title: CouchDB - path: /compose/django/ title: Django and PostgreSQL - path: /compose/wordpress/ title: WordPress - - path: /engine/examples/postgresql_service/ + - path: /samples/postgresql_service/ title: PostgreSQL - path: /compose/rails/ title: Rails and PostgreSQL - - path: /engine/examples/running_riak_service/ + - path: /samples/running_riak_service/ title: Riak - - path: /engine/examples/running_ssh_service/ + - path: /samples/running_ssh_service/ title: SSHd - path: /samples/#library-references title: Library references diff --git a/develop/index.md b/develop/index.md index f0de55c789..e93e412c66 100644 --- a/develop/index.md +++ b/develop/index.md @@ -27,7 +27,7 @@ most benefits from Docker. - [Docker for Java developers lab](https://github.com/docker/labs/tree/master/developer-tools/java/){: target="_blank" rel="noopener" class="_"} - [Port a node.js app to Docker lab](https://github.com/docker/labs/tree/master/developer-tools/nodejs/porting){: target="_blank" rel="noopener" class="_"} - [Ruby on Rails app on Docker lab](https://github.com/docker/labs/tree/master/developer-tools/ruby){: target="_blank" rel="noopener" class="_"} -- [Dockerize a .Net Core application](../engine/examples/dotnetcore.md){: target="_blank" rel="noopener" class="_"} +- [Dockerize a .Net Core application](../samples/dotnetcore.md){: target="_blank" rel="noopener" class="_"} - [Dockerize an ASP.NET Core application with SQL Server on Linux](../compose/aspnet-mssql-compose.md){: target="_blank" rel="noopener" class="_"} using Docker Compose ## Advanced development with the SDK or API diff --git a/docker-for-windows/index.md b/docker-for-windows/index.md index 60eaabd4ae..63c52e6bb4 100644 --- a/docker-for-windows/index.md +++ b/docker-for-windows/index.md @@ -6,6 +6,7 @@ redirect_from: - /docker-for-windows/started/ - /engine/installation/windows/ - /installation/windows/ +- /win/ - /windows/ - /windows/started/ - /winkit/ diff --git a/engine/examples/index.md b/engine/examples/index.md deleted file mode 100644 index 8c24111c1f..0000000000 --- a/engine/examples/index.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: Provides examples for using Docker -keywords: dockerize, dockerizing apps, dockerizing applications, container, containers -title: Dockerize an application -redirect_from: -- /en/latest/examples/ ---- - -This section contains the following: - -* [Dockerizing PostgreSQL](postgresql_service.md) -* [Dockerizing a CouchDB service](couchdb_data_volumes.md) -* [Dockerizing an apt-cacher-ng service](apt-cacher-ng.md) -* [Dockerizing an ASP.NET Core application](dotnetcore.md) -* [Get Started](/get-started/) diff --git a/get-started/index.md b/get-started/index.md index 67e52701b8..d2e0d7dfb7 100644 --- a/get-started/index.md +++ b/get-started/index.md @@ -18,6 +18,8 @@ redirect_from: - /engine/getstarted/step_six/ - /engine/getstarted/step_three/ - /engine/getstarted/step_two/ +- /engine/quickstart/ +- /engine/tutorials/ - /engine/tutorials/dockerimages/ - /engine/tutorials/dockerizing/ - /engine/tutorials/usingdocker/ diff --git a/engine/examples/apt-cacher-ng.Dockerfile b/samples/apt-cacher-ng.Dockerfile similarity index 100% rename from engine/examples/apt-cacher-ng.Dockerfile rename to samples/apt-cacher-ng.Dockerfile diff --git a/engine/examples/apt-cacher-ng.md b/samples/apt-cacher-ng.md similarity index 96% rename from engine/examples/apt-cacher-ng.md rename to samples/apt-cacher-ng.md index 9723b9e237..0057d98f17 100644 --- a/engine/examples/apt-cacher-ng.md +++ b/samples/apt-cacher-ng.md @@ -2,11 +2,13 @@ description: Installing and running an apt-cacher-ng service keywords: docker, example, package installation, networking, debian, ubuntu title: Dockerize an apt-cacher-ng service +redirect_from: + - /engine/examples/apt-cacher-ng/ --- > **Note**: > - **If you don't like sudo** then see -> [*Giving non-root access*](../install/linux-postinstall.md#manage-docker-as-a-non-root-user). +> [*Giving non-root access*](../engine/install/linux-postinstall.md#manage-docker-as-a-non-root-user). > - **If you're using macOS or docker via TCP** then you shouldn't use sudo. When you have multiple Docker servers, or build unrelated Docker diff --git a/engine/examples/couchbase/web-console.png b/samples/couchbase/web-console.png similarity index 100% rename from engine/examples/couchbase/web-console.png rename to samples/couchbase/web-console.png diff --git a/engine/examples/couchdb_data_volumes.md b/samples/couchdb_data_volumes.md similarity index 92% rename from engine/examples/couchdb_data_volumes.md rename to samples/couchdb_data_volumes.md index b9d2d441c1..065993214d 100644 --- a/engine/examples/couchdb_data_volumes.md +++ b/samples/couchdb_data_volumes.md @@ -2,11 +2,13 @@ description: Sharing data between 2 couchdb databases keywords: docker, example, package installation, networking, couchdb, data volumes title: Dockerize a CouchDB service +redirect_from: + - /engine/examples/couchdb_data_volumes/ --- > **Note** > -> **If you don't like sudo** then see [*Giving non-root access*](../install/linux-postinstall.md#manage-docker-as-a-non-root-user) +> **If you don't like sudo** then see [*Giving non-root access*](../engine/install/linux-postinstall.md#manage-docker-as-a-non-root-user) Here's an example of using data volumes to share the same data between two CouchDB containers. This could be used for hot upgrades, testing diff --git a/engine/examples/dotnetcore.md b/samples/dotnetcore.md similarity index 80% rename from engine/examples/dotnetcore.md rename to samples/dotnetcore.md index 31fcea55c3..7914d421a7 100644 --- a/engine/examples/dotnetcore.md +++ b/samples/dotnetcore.md @@ -2,6 +2,8 @@ description: Create a Docker image by layering your ASP.NET Core app on debian for Linux Containers or with Windows Nano Server containers using a Dockerfile. keywords: dockerize, dockerizing, dotnet, .NET, Core, article, example, platform, installation, containers, images, image, dockerfile, build, asp.net, asp.net core title: Dockerize an ASP.NET Core application +redirect_from: +- /engine/examples/dotnetcore/ --- ## Introduction @@ -15,9 +17,8 @@ This example demonstrates how to dockerize an ASP.NET Core application. Linux - Great for modern cloud-based apps, such as web apps, IoT apps, and mobile backends -- ASP.NET Core apps can run on [.NET - Core](https://www.microsoft.com/net/core/platform) or on the full [.NET - Framework](https://www.microsoft.com/net/framework) +- ASP.NET Core apps can run on [.NET Core](https://www.microsoft.com/net/core/platform) + or on the full [.NET Framework](https://www.microsoft.com/net/framework) - Designed to provide an optimized development framework for apps that are deployed to the cloud or run on-premises - Modular components with minimal overhead retain flexibility while @@ -26,20 +27,21 @@ constructing your solutions ## Prerequisites This example assumes you already have an ASP.NET Core app -on your machine. If you are new to ASP.NET you can follow a [simple -tutorial](https://www.asp.net/get-started) to initialize a project or clone our [ASP.NET Docker Sample](https://github.com/dotnet/dotnet-docker/tree/master/samples/aspnetapp). +on your machine. If you are new to ASP.NET you can follow a +[simple tutorial](https://www.asp.net/get-started) to initialize a project or +clone our [ASP.NET Docker Sample](https://github.com/dotnet/dotnet-docker/tree/master/samples/aspnetapp). ## Create a Dockerfile for an ASP.NET Core application ### Method 1: 1. Create a `Dockerfile` in your project folder. -2. Add the text below to your `Dockerfile` for either Linux or [Windows - Containers](https://docs.microsoft.com/virtualization/windowscontainers/about/). +2. Add the text below to your `Dockerfile` for either Linux or + [Windows Containers](https://docs.microsoft.com/virtualization/windowscontainers/about/). The tags below are multi-arch meaning they pull either Windows or Linux containers depending on what mode is set in - [Docker Desktop for Windows](../../docker-for-windows/index.md). Read more on - [switching containers](../../docker-for-windows/index.md#switch-between-windows-and-linux-containers). + [Docker Desktop for Windows](../docker-for-windows/index.md). Read more on + [switching containers](../docker-for-windows/index.md#switch-between-windows-and-linux-containers). 3. The `Dockerfile` assumes that your application is called `aspnetapp`. Change the `Dockerfile` to use the DLL file of your project. @@ -52,7 +54,7 @@ COPY *.csproj ./ RUN dotnet restore # Copy everything else and build -COPY . ./ +COPY ../engine/examples ./ RUN dotnet publish -c Release -o out # Build runtime image @@ -73,12 +75,12 @@ obj/ ### Method 2 (build app outside Docker container): 1. Create a `Dockerfile` in your project folder. -2. Add the text below to your `Dockerfile` for either Linux or [Windows - Containers](https://docs.microsoft.com/virtualization/windowscontainers/about/). +2. Add the text below to your `Dockerfile` for either Linux or + [Windows Containers](https://docs.microsoft.com/virtualization/windowscontainers/about/). The tags below are multi-arch meaning they pull either Windows or Linux containers depending on what mode is set in - [Docker Desktop for Windows](../../docker-for-windows/index.md). Read more on - [switching containers](../../docker-for-windows/index.md#switch-between-windows-and-linux-containers). + [Docker Desktop for Windows](../docker-for-windows/index.md). Read more on + [switching containers](../docker-for-windows/index.md#switch-between-windows-and-linux-containers). 3. The `Dockerfile` assumes that your application is called `aspnetapp`. Change the `Dockerfile` to use the DLL file of your project. This method assumes that your project is already built and it copies the build artifacts from the publish folder. Refer to the Microsoft documentation on [Containerize a .Net Core app](https://docs.microsoft.com/en-us/dotnet/core/docker/build-container?tabs=windows#create-the-dockerfile){: target="blank" rel="noopener" class=“"}. The `docker build` step here will be much faster than method 1, as all the artifacts are built outside of the `docker build` step and the size of the base image is much smaller compared to the build base image. @@ -109,7 +111,7 @@ $ docker run -d -p 8080:80 --name myapp aspnetapp ## View the web page running from a container * Go to [localhost:8080](http://localhost:8080) to access your app in a web browser. -* If you are using the Nano [Windows Container](../../docker-for-windows/index.md) +* If you are using the Nano [Windows Container](../docker-for-windows/index.md) and have not updated to the Windows Creator Update there is a bug affecting how [Windows 10 talks to Containers via "NAT"](https://github.com/Microsoft/Virtualization-Documentation/issues/181#issuecomment-252671828) (Network Address Translation). You must hit the IP of the container diff --git a/samples/index.md b/samples/index.md index 8dac427648..c6cdaf6dd2 100644 --- a/samples/index.md +++ b/samples/index.md @@ -1,6 +1,10 @@ --- title: Samples description: Learn how to develop and ship containerized applications, by walking through samples that exhibits canonical practices. +redirect_from: +- /en/latest/examples/ +- /engine/examples/ +- /examples/ --- {% assign labsbase = "https://github.com/docker/labs/tree/master" %} @@ -30,15 +34,15 @@ Run popular software using Docker. | Sample | Description | | ------------------------------------------------------------------------- | --------------------------------------------------------- | -| [apt-cacher-ng](../engine/examples/apt-cacher-ng.md) | Run a Dockerized apt-cacher-ng instance. | -| [.Net Core application](../engine/examples/dotnetcore.md) | Run a Dockerized ASP.NET Core application. | +| [apt-cacher-ng](apt-cacher-ng.md) | Run a Dockerized apt-cacher-ng instance. | +| [.Net Core application](dotnetcore.md) | Run a Dockerized ASP.NET Core application. | | [ASP.NET Core + SQL Server on Linux](../compose/aspnet-mssql-compose.md) | Run a Dockerized ASP.NET Core + SQL Server environment. | -| [CouchDB](../engine/examples/couchdb_data_volumes.md) | Run a Dockerized CouchDB instance. | +| [CouchDB](couchdb_data_volumes.md) | Run a Dockerized CouchDB instance. | | [Django + PostgreSQL](../compose/django.md) | Run a Dockerized Django + PostgreSQL environment. | -| [PostgreSQL](../engine/examples/postgresql_service.md) | Run a Dockerized PostgreSQL instance. | +| [PostgreSQL](postgresql_service.md) | Run a Dockerized PostgreSQL instance. | | [Rails + PostgreSQL](../compose/rails.md) | Run a Dockerized Rails + PostgreSQL environment. | -| [Riak](../engine/examples/running_riak_service.md) | Run a Dockerized Riak instance. | -| [SSHd](../engine/examples/running_ssh_service.md) | Run a Dockerized SSHd instance. | +| [Riak](running_riak_service.md) | Run a Dockerized Riak instance. | +| [SSHd](running_ssh_service.md) | Run a Dockerized SSHd instance. | | [WordPress](../compose/wordpress.md) | Quickstart: Compose and WordPress. | ## Library references diff --git a/engine/examples/postgresql_service.Dockerfile b/samples/postgresql_service.Dockerfile similarity index 100% rename from engine/examples/postgresql_service.Dockerfile rename to samples/postgresql_service.Dockerfile diff --git a/engine/examples/postgresql_service.md b/samples/postgresql_service.md similarity index 98% rename from engine/examples/postgresql_service.md rename to samples/postgresql_service.md index 6fef7a9878..7434d27feb 100644 --- a/engine/examples/postgresql_service.md +++ b/samples/postgresql_service.md @@ -2,6 +2,8 @@ description: Running and installing a PostgreSQL service keywords: docker, example, package installation, postgresql title: Dockerize PostgreSQL +redirect_from: + - /engine/examples/postgresql_service/ --- ## Install PostgreSQL on Docker @@ -80,7 +82,7 @@ $ docker run --rm -P --name pg_test eg_postgresql ``` There are two ways to connect to the PostgreSQL server. We can use -[*Link Containers*](../../network/links.md), +[*Link Containers*](../network/links.md), or we can access it from our host (or the network). > **Note**: The `--rm` removes the container and its image when diff --git a/engine/examples/running_riak_service.Dockerfile b/samples/running_riak_service.Dockerfile similarity index 100% rename from engine/examples/running_riak_service.Dockerfile rename to samples/running_riak_service.Dockerfile diff --git a/engine/examples/running_riak_service.md b/samples/running_riak_service.md similarity index 98% rename from engine/examples/running_riak_service.md rename to samples/running_riak_service.md index ed57407ba9..ee4620e431 100644 --- a/engine/examples/running_riak_service.md +++ b/samples/running_riak_service.md @@ -2,6 +2,8 @@ description: Build a Docker image with Riak pre-installed keywords: docker, example, package installation, networking, riak title: Dockerize a Riak service +redirect_from: + - /engine/examples/running_riak_service/ --- The goal of this example is to show you how to build a Docker image with diff --git a/engine/examples/running_ssh_service.md b/samples/running_ssh_service.md similarity index 88% rename from engine/examples/running_ssh_service.md rename to samples/running_ssh_service.md index eca95c12b4..1df0277d7a 100644 --- a/engine/examples/running_ssh_service.md +++ b/samples/running_ssh_service.md @@ -2,6 +2,8 @@ description: Installing and running an SSHd service on Docker keywords: docker, example, package installation, networking title: Dockerize an SSH service +redirect_from: + - /engine/examples/running_ssh_service/ --- Running sshd inside a container is discouraged, however, it might be still useful diff --git a/engine/examples/supervisord.conf b/samples/supervisord.conf similarity index 100% rename from engine/examples/supervisord.conf rename to samples/supervisord.conf