Merge pull request #12667 from thaJeztah/more_redirects

Add / update some redirects for old URLs and unify samples
This commit is contained in:
Usha Mandya 2021-04-19 10:12:50 +01:00 committed by GitHub
commit 30d2bd1e87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 336 additions and 357 deletions

View File

@ -948,7 +948,7 @@ reference:
title: docker wait
- sectiontitle: Docker Compose CLI reference
section:
- path: /compose/reference/overview/
- path: /compose/reference/
title: Overview of docker-compose CLI
- path: /compose/reference/envvars/
title: CLI environment variables
@ -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/
- path: /samples/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/
- path: /samples/django/
title: Django and PostgreSQL
- path: /compose/wordpress/
- path: /samples/wordpress/
title: WordPress
- path: /engine/examples/postgresql_service/
- path: /samples/postgresql_service/
title: PostgreSQL
- path: /compose/rails/
- path: /samples/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

View File

@ -31,7 +31,7 @@ the rules described in
To use multiple override files, or an override file with a different name, you
can use the `-f` option to specify the list of files. Compose merges files in
the order they're specified on the command line. See the
[`docker-compose` command reference](reference/overview.md) for more information
[`docker-compose` command reference](reference/index.md) for more information
about using `-f`.
When you use multiple configuration files, you must make sure all paths in the

View File

@ -57,7 +57,7 @@ handling `SIGTERM` properly.
Compose uses the project name to create unique identifiers for all of a
project's containers and other resources. To run multiple copies of a project,
set a custom project name using the [`-p` command line option](reference/overview.md)
set a custom project name using the [`-p` command line option](reference/index.md)
or the [`COMPOSE_PROJECT_NAME` environment variable](reference/envvars.md#compose_project_name).
## What's the difference between `up`, `run`, and `start`?

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

View File

@ -64,9 +64,9 @@ Compose has commands for managing the whole lifecycle of your application:
- [Installing Compose](install.md)
- [Getting started with Compose](gettingstarted.md)
- [Get started with Django](django.md)
- [Get started with Rails](rails.md)
- [Get started with WordPress](wordpress.md)
- [Get started with Django](../samples/django.md)
- [Get started with Rails](../samples/rails.md)
- [Get started with WordPress](../samples/wordpress.md)
- [Frequently asked questions](faq.md)
- [Command line reference](reference/index.md)
- [Compose file reference](compose-file/index.md)
@ -92,7 +92,7 @@ Compose uses a project name to isolate environments from each other. You can mak
The default project name is the basename of the project directory. You can set
a custom project name by using the
[`-p` command line option](reference/overview.md) or the
[`-p` command line option](reference/index.md) or the
[`COMPOSE_PROJECT_NAME` environment variable](reference/envvars.md#compose_project_name).
The default project directory is the base directory of the Compose file. A custom value

View File

@ -16,7 +16,7 @@ identical to the container name.
>
> Your app's network is given a name based on the "project name",
> which is based on the name of the directory it lives in. You can override the
> project name with either the [`--project-name` flag](reference/overview.md)
> project name with either the [`--project-name` flag](reference/index.md)
> or the [`COMPOSE_PROJECT_NAME` environment variable](reference/envvars.md#compose_project_name).
For example, suppose your app is in a directory called `myapp`, and your `docker-compose.yml` looks like this:

View File

@ -57,7 +57,7 @@ Valid profile names follow the regex format of `[a-zA-Z0-9][a-zA-Z0-9_.-]+`.
## Enabling profiles
To enable a profile supply the `--profile` [command-line option](reference/overview.md) or
To enable a profile supply the `--profile` [command-line option](reference/index.md) or
use the [`COMPOSE_PROFILES` environment variable](reference/envvars.md#compose_profiles):
```sh

View File

@ -21,7 +21,7 @@ includes two services `db` and `web`, then Compose starts containers named
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`
[command-line option](overview.md).
[command-line option](index.md).
## COMPOSE\_FILE
@ -34,7 +34,7 @@ Linux and macOS the path separator is `:`, on Windows it is `;`). For example:
`COMPOSE_FILE=docker-compose.yml:docker-compose.prod.yml`. The path separator
can also be customized using `COMPOSE_PATH_SEPARATOR`.
See also the `-f` [command-line option](overview.md).
See also the `-f` [command-line option](index.md).
## COMPOSE\_PROFILES
@ -47,7 +47,7 @@ You can specify a list of profiles separated with a comma:
`debug`.
See also [_Using profiles with Compose_](../profiles.md) and the `--profile`
[command-line option](overview.md).
[command-line option](index.md#use---profile-to-specify-one-or-more-active-profiles).
## COMPOSE\_API\_VERSION

View File

@ -1,39 +1,203 @@
---
description: Compose CLI reference
keywords: fig, composition, compose, docker, orchestration, cli, reference
title: Compose command-line reference
notoc: true
description: Overview of docker-compose CLI
keywords: fig, composition, compose, docker, orchestration, cli, reference, docker-compose
redirect_from:
- /compose/reference/docker-compose/
- /compose/reference/overview/
title: Overview of docker-compose CLI
---
The following pages describe the usage information for the [docker-compose](overview.md) subcommands. You can also see this information by running `docker-compose [SUBCOMMAND] --help` from the command line.
This page provides the usage information for the `docker-compose` Command.
* [docker-compose](overview.md)
* [build](build.md)
* [config](config.md)
* [create](create.md)
* [down](down.md)
* [events](events.md)
* [exec](exec.md)
* [help](help.md)
* [images](images.md)
* [kill](kill.md)
* [logs](logs.md)
* [pause](pause.md)
* [port](port.md)
* [ps](ps.md)
* [pull](pull.md)
* [push](push.md)
* [restart](restart.md)
* [rm](rm.md)
* [run](run.md)
* [scale](scale.md)
* [start](start.md)
* [stop](stop.md)
* [top](top.md)
* [unpause](unpause.md)
* [up](up.md)
## Command options overview and help
You can also see this information by running `docker-compose --help` from the
command line.
```none
Define and run multi-container applications with Docker.
Usage:
docker-compose [-f <arg>...] [--profile <name>...] [options] [COMMAND] [ARGS...]
docker-compose -h|--help
Options:
-f, --file FILE Specify an alternate compose file
(default: docker-compose.yml)
-p, --project-name NAME Specify an alternate project name
(default: directory name)
--profile NAME Specify a profile to enable
--verbose Show more output
--log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
--no-ansi Do not print ANSI control characters
-v, --version Print version and exit
-H, --host HOST Daemon socket to connect to
--tls Use TLS; implied by --tlsverify
--tlscacert CA_PATH Trust certs signed only by this CA
--tlscert CLIENT_CERT_PATH Path to TLS certificate file
--tlskey TLS_KEY_PATH Path to TLS key file
--tlsverify Use TLS and verify the remote
--skip-hostname-check Don't check the daemon's hostname against the
name specified in the client certificate
--project-directory PATH Specify an alternate working directory
(default: the path of the Compose file)
--compatibility If set, Compose will attempt to convert deploy
keys in v3 files to their non-Swarm equivalent
Commands:
build Build or rebuild services
bundle Generate a Docker bundle from the Compose file
config Validate and view the Compose file
create Create services
down Stop and remove containers, networks, images, and volumes
events Receive real time events from containers
exec Execute a command in a running container
help Get help on a command
images List images
kill Kill containers
logs View output from containers
pause Pause services
port Print the public port for a port binding
ps List containers
pull Pull service images
push Push service images
restart Restart services
rm Remove stopped containers
run Run a one-off command
scale Set number of containers for a service
start Start services
stop Stop services
top Display the running processes
unpause Unpause services
up Create and start containers
version Show the Docker-Compose version information
```
You can use Docker Compose binary, `docker-compose [-f <arg>...] [options]
[COMMAND] [ARGS...]`, to build and manage multiple services in Docker containers.
## Use `-f` to specify name and path of one or more Compose files
Use the `-f` flag to specify the location of a Compose configuration file.
### Specifying multiple Compose files
You can supply multiple `-f` configuration files. When you supply multiple
files, Compose combines them into a single configuration. Compose builds the
configuration in the order you supply the files. Subsequent files override and
add to their predecessors.
For example, consider this command line:
```
$ docker-compose -f docker-compose.yml -f docker-compose.admin.yml run backup_db
```
The `docker-compose.yml` file might specify a `webapp` service.
```
webapp:
image: examples/web
ports:
- "8000:8000"
volumes:
- "/data"
```
If the `docker-compose.admin.yml` also specifies this same service, any matching
fields override the previous file. New values, add to the `webapp` service
configuration.
```
webapp:
build: .
environment:
- DEBUG=1
```
When you use multiple Compose files, all paths in the files are relative to the
first configuration file specified with `-f`. You can use the
`--project-directory` option to override this base path.
Use a `-f` with `-` (dash) as the filename to read the configuration from
`stdin`. When `stdin` is used all paths in the configuration are
relative to the current working directory.
The `-f` flag is optional. If you don't provide this flag on the command line,
Compose traverses the working directory and its parent directories looking for a
`docker-compose.yml` and a `docker-compose.override.yml` file. You must supply
at least the `docker-compose.yml` file. If both files are present on the same
directory level, Compose combines the two files into a single configuration.
The configuration in the `docker-compose.override.yml` file is applied over and
in addition to the values in the `docker-compose.yml` file.
### Specifying a path to a single Compose file
You can use the `-f` flag to specify a path to a Compose file that is not
located in the current directory, either from the command line or by setting up
a [COMPOSE_FILE environment variable](envvars.md#compose_file) in your shell or
in an environment file.
For an example of using the `-f` option at the command line, suppose you are
running the [Compose Rails sample](../../samples/rails.md), and
have a `docker-compose.yml` file in a directory called `sandbox/rails`. You can
use a command like [docker-compose pull](pull.md) to get the
postgres image for the `db` service from anywhere by using the `-f` flag as
follows: `docker-compose -f ~/sandbox/rails/docker-compose.yml pull db`
Here's the full example:
```
$ docker-compose -f ~/sandbox/rails/docker-compose.yml pull db
Pulling db (postgres:latest)...
latest: Pulling from library/postgres
ef0380f84d05: Pull complete
50cf91dc1db8: Pull complete
d3add4cd115c: Pull complete
467830d8a616: Pull complete
089b9db7dc57: Pull complete
6fba0a36935c: Pull complete
81ef0e73c953: Pull complete
338a6c4894dc: Pull complete
15853f32f67c: Pull complete
044c83d92898: Pull complete
17301519f133: Pull complete
dcca70822752: Pull complete
cecf11b8ccf3: Pull complete
Digest: sha256:1364924c753d5ff7e2260cd34dc4ba05ebd40ee8193391220be0f9901d4e1651
Status: Downloaded newer image for postgres:latest
```
## Use `-p` to specify a project name
Each configuration has a project name. If you supply a `-p` flag, you can
specify a project name. If you don't specify the flag, Compose uses the current
directory name. See also the [COMPOSE_PROJECT_NAME environment variable](envvars.md#compose_project_name).
## Use `--profile` to specify one or more active profiles
Calling `docker-compose --profile frontend up` will start the services with the
profile `frontend` and services without specified profiles. You can also enable
multiple profiles, e.g. with `docker-compose --profile frontend --profile debug up`
the profiles `frontend` and `debug` will be enabled.
See also [_Using profiles with Compose_](../profiles.md) and the
[`COMPOSE_PROFILES` environment variable](envvars.md#compose_profiles).
## Set up environment variables
You can set [environment variables](envvars.md) for various
`docker-compose` options, including the `-f` and `-p` flags.
For example, the [COMPOSE_FILE environment variable](envvars.md#compose_file)
relates to the `-f` flag, and `COMPOSE_PROJECT_NAME`
[environment variable](envvars.md#compose_project_name) relates to the `-p` flag.
Also, you can set some of these variables in an [environment file](../env-file.md).
## Where to go next
* [CLI environment variables](envvars.md)
* [docker-compose Command](overview.md)
* [Declare default environment variables in file](../env-file.md)

View File

@ -1,202 +0,0 @@
---
description: Overview of docker-compose CLI
keywords: fig, composition, compose, docker, orchestration, cli, docker-compose
redirect_from:
- /compose/reference/docker-compose/
title: Overview of docker-compose CLI
---
This page provides the usage information for the `docker-compose` Command.
## Command options overview and help
You can also see this information by running `docker-compose --help` from the
command line.
```none
Define and run multi-container applications with Docker.
Usage:
docker-compose [-f <arg>...] [--profile <name>...] [options] [COMMAND] [ARGS...]
docker-compose -h|--help
Options:
-f, --file FILE Specify an alternate compose file
(default: docker-compose.yml)
-p, --project-name NAME Specify an alternate project name
(default: directory name)
--profile NAME Specify a profile to enable
--verbose Show more output
--log-level LEVEL Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
--no-ansi Do not print ANSI control characters
-v, --version Print version and exit
-H, --host HOST Daemon socket to connect to
--tls Use TLS; implied by --tlsverify
--tlscacert CA_PATH Trust certs signed only by this CA
--tlscert CLIENT_CERT_PATH Path to TLS certificate file
--tlskey TLS_KEY_PATH Path to TLS key file
--tlsverify Use TLS and verify the remote
--skip-hostname-check Don't check the daemon's hostname against the
name specified in the client certificate
--project-directory PATH Specify an alternate working directory
(default: the path of the Compose file)
--compatibility If set, Compose will attempt to convert deploy
keys in v3 files to their non-Swarm equivalent
Commands:
build Build or rebuild services
bundle Generate a Docker bundle from the Compose file
config Validate and view the Compose file
create Create services
down Stop and remove containers, networks, images, and volumes
events Receive real time events from containers
exec Execute a command in a running container
help Get help on a command
images List images
kill Kill containers
logs View output from containers
pause Pause services
port Print the public port for a port binding
ps List containers
pull Pull service images
push Push service images
restart Restart services
rm Remove stopped containers
run Run a one-off command
scale Set number of containers for a service
start Start services
stop Stop services
top Display the running processes
unpause Unpause services
up Create and start containers
version Show the Docker-Compose version information
```
You can use Docker Compose binary, `docker-compose [-f <arg>...] [options]
[COMMAND] [ARGS...]`, to build and manage multiple services in Docker containers.
## Use `-f` to specify name and path of one or more Compose files
Use the `-f` flag to specify the location of a Compose configuration file.
### Specifying multiple Compose files
You can supply multiple `-f` configuration files. When you supply multiple
files, Compose combines them into a single configuration. Compose builds the
configuration in the order you supply the files. Subsequent files override and
add to their predecessors.
For example, consider this command line:
```
$ docker-compose -f docker-compose.yml -f docker-compose.admin.yml run backup_db
```
The `docker-compose.yml` file might specify a `webapp` service.
```
webapp:
image: examples/web
ports:
- "8000:8000"
volumes:
- "/data"
```
If the `docker-compose.admin.yml` also specifies this same service, any matching
fields override the previous file. New values, add to the `webapp` service
configuration.
```
webapp:
build: .
environment:
- DEBUG=1
```
When you use multiple Compose files, all paths in the files are relative to the
first configuration file specified with `-f`. You can use the
`--project-directory` option to override this base path.
Use a `-f` with `-` (dash) as the filename to read the configuration from
`stdin`. When `stdin` is used all paths in the configuration are
relative to the current working directory.
The `-f` flag is optional. If you don't provide this flag on the command line,
Compose traverses the working directory and its parent directories looking for a
`docker-compose.yml` and a `docker-compose.override.yml` file. You must supply
at least the `docker-compose.yml` file. If both files are present on the same
directory level, Compose combines the two files into a single configuration.
The configuration in the `docker-compose.override.yml` file is applied over and
in addition to the values in the `docker-compose.yml` file.
### Specifying a path to a single Compose file
You can use the `-f` flag to specify a path to a Compose file that is not
located in the current directory, either from the command line or by setting up
a [COMPOSE_FILE environment variable](envvars.md#compose_file) in your shell or
in an environment file.
For an example of using the `-f` option at the command line, suppose you are
running the [Compose Rails sample](../rails.md), and
have a `docker-compose.yml` file in a directory called `sandbox/rails`. You can
use a command like [docker-compose pull](pull.md) to get the
postgres image for the `db` service from anywhere by using the `-f` flag as
follows: `docker-compose -f ~/sandbox/rails/docker-compose.yml pull db`
Here's the full example:
```
$ docker-compose -f ~/sandbox/rails/docker-compose.yml pull db
Pulling db (postgres:latest)...
latest: Pulling from library/postgres
ef0380f84d05: Pull complete
50cf91dc1db8: Pull complete
d3add4cd115c: Pull complete
467830d8a616: Pull complete
089b9db7dc57: Pull complete
6fba0a36935c: Pull complete
81ef0e73c953: Pull complete
338a6c4894dc: Pull complete
15853f32f67c: Pull complete
044c83d92898: Pull complete
17301519f133: Pull complete
dcca70822752: Pull complete
cecf11b8ccf3: Pull complete
Digest: sha256:1364924c753d5ff7e2260cd34dc4ba05ebd40ee8193391220be0f9901d4e1651
Status: Downloaded newer image for postgres:latest
```
## Use `-p` to specify a project name
Each configuration has a project name. If you supply a `-p` flag, you can
specify a project name. If you don't specify the flag, Compose uses the current
directory name. See also the [COMPOSE_PROJECT_NAME environment variable](envvars.md#compose_project_name).
## Use `--profile` to specify one or more active profiles
Calling `docker-compose --profile frontend up` will start the services with the
profile `frontend` and services without specified profiles. You can also enable
multiple profiles, e.g. with `docker-compose --profile frontend --profile debug up`
the profiles `frontend` and `debug` will be enabled.
See also [_Using profiles with Compose_](../profiles.md) and the
[`COMPOSE_PROFILES` environment variable](envvars.md#compose_profiles).
## Set up environment variables
You can set [environment variables](envvars.md) for various
`docker-compose` options, including the `-f` and `-p` flags.
For example, the [COMPOSE_FILE environment variable](envvars.md#compose_file)
relates to the `-f` flag, and `COMPOSE_PROJECT_NAME`
[environment variable](envvars.md#compose_project_name) relates to the `-p` flag.
Also, you can set some of these variables in an [environment file](../env-file.md).
## Where to go next
* [CLI environment variables](envvars.md)
* [Declare default environment variables in file](../env-file.md)

View File

@ -18,7 +18,7 @@ Options:
Pulls an image associated with a service defined in a `docker-compose.yml` or `docker-stack.yml` file, but does not start containers based on those images.
For example, suppose you have this `docker-compose.yml` file from the [Quickstart: Compose and Rails](../rails.md) sample.
For example, suppose you have this `docker-compose.yml` file from the [Quickstart: Compose and Rails](../../samples/rails.md) sample.
```yaml
version: '2'

View File

@ -24,12 +24,12 @@ The samples should help you to:
These samples focus specifically on Docker Compose:
- [Quickstart: Compose and Django](django.md) - Shows how to use Docker Compose to set up and run a simple Django/PostgreSQL app.
- [Quickstart: Compose and Django](../samples/django.md) - Shows how to use Docker Compose to set up and run a simple Django/PostgreSQL app.
- [Quickstart: Compose and Rails](rails.md) - Shows how to use
- [Quickstart: Compose and Rails](../samples/rails.md) - Shows how to use
Docker Compose to set up and run a Rails/PostgreSQL app.
- [Quickstart: Compose and WordPress](wordpress.md) - Shows how to
- [Quickstart: Compose and WordPress](../samples/wordpress.md) - Shows how to
use Docker Compose to set up and run WordPress in an isolated environment
with Docker containers.

View File

@ -27,8 +27,8 @@ 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 an ASP.NET Core application with SQL Server on Linux](../compose/aspnet-mssql-compose.md){: target="_blank" rel="noopener" class="_"} using Docker Compose
- [Dockerize a .Net Core application](../samples/dotnetcore.md){: target="_blank" rel="noopener" class="_"}
- [Dockerize an ASP.NET Core application with SQL Server on Linux](../samples/aspnet-mssql-compose.md){: target="_blank" rel="noopener" class="_"} using Docker Compose
## Advanced development with the SDK or API

View File

@ -6,6 +6,7 @@ redirect_from:
- /docker-for-windows/started/
- /engine/installation/windows/
- /installation/windows/
- /win/
- /windows/
- /windows/started/
- /winkit/

View File

@ -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/)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View File

@ -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/

View File

@ -12,7 +12,7 @@ various APIs, CLIs, and file formats.
| File format | Description |
|:--------------------------------------------------------------------|:----------------------------------------------------------------|
| [Dockerfile](/engine/reference/builder/) | Defines the contents and startup behavior of a single container |
| [Compose file](/compose/compose-file/) | Defines a multi-container application |
| [Compose file](/compose/compose-file/index.md) | Defines a multi-container application |
## Command-line interfaces (CLIs)
@ -20,7 +20,7 @@ various APIs, CLIs, and file formats.
| CLI | Description |
|:---------------------------------------------------------------|:-------------------------------------------------------------------------------------------|
| [Docker CLI](/engine/reference/commandline/cli/) | The main CLI for Docker, includes all `docker` commands |
| [Compose CLI](/compose/reference/overview/) | The CLI for Docker Compose, which allows you to build and run multi-container applications |
| [Compose CLI](/compose/reference/index.md) | The CLI for Docker Compose, which allows you to build and run multi-container applications |
| [Daemon CLI (dockerd)](/engine/reference/commandline/dockerd/) | Persistent process that manages containers |

View File

@ -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

View File

@ -2,6 +2,8 @@
description: Create a Docker Compose application using ASP.NET Core and SQL Server on Linux in Docker.
keywords: dotnet, .NET, Core, example, ASP.NET Core, SQL Server, mssql
title: "Quickstart: Compose and ASP.NET Core with SQL Server"
redirect_from:
- /compose/aspnet-mssql-compose/
---
This quick-start guide demonstrates how to use Docker Engine on Linux and Docker
@ -10,7 +12,7 @@ Compose to set up and run the sample ASP.NET Core application using the
with the
[SQL Server on Linux image](https://hub.docker.com/_/microsoft-mssql-server).
You just need to have [Docker Engine](../get-docker.md)
and [Docker Compose](install.md) installed on your
and [Docker Compose](../compose/install.md) installed on your
platform of choice: Linux, Mac or Windows.
For this sample, we create a sample .NET Core Web Application using the
@ -201,3 +203,12 @@ to try out .NET Framework and more SQL Server tutorials.
- [SQL Server on Docker Hub](https://hub.docker.com/r/microsoft/mssql-server/)
- [ASP.NET Core](https://www.asp.net/core)
- [ASP.NET Core Docker image](https://hub.docker.com/r/microsoft/aspnetcore/) on DockerHub
## More Compose documentation
- [Docker Compose overview](../compose/index.md)
- [Install Docker Compose](../compose/install.md)
- [Getting Started with Docker Compose](../compose/gettingstarted.md)
- [Docker Compose Command line reference](../compose/reference/index.md)
- [Compose file reference](../compose/compose-file/index.md)
- [Awesome Compose samples](https://github.com/docker/awesome-compose/){:target="_blank" rel="noopener" class="_"}

View File

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -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

View File

@ -2,10 +2,12 @@
description: Getting started with Docker Compose and Django
keywords: documentation, docs, docker, compose, orchestration, containers
title: "Quickstart: Compose and Django"
redirect_from:
- /compose/django/
---
This quick-start guide demonstrates how to use Docker Compose to set up and run a simple Django/PostgreSQL app. Before starting,
[install Compose](install.md).
[install Compose](../compose/install.md).
### Define the project components
@ -58,7 +60,7 @@ and a `docker-compose.yml` file. (You can use either a `.yml` or `.yaml` extensi
also describes which Docker images these services use, how they link
together, any volumes they might need to be mounted inside the containers.
Finally, the `docker-compose.yml` file describes which ports these services
expose. See the [`docker-compose.yml` reference](compose-file/index.md) for more
expose. See the [`docker-compose.yml` reference](../compose/compose-file/index.md) for more
information on how this file works.
9. Add the following configuration to the file.
@ -102,7 +104,7 @@ In this step, you create a Django starter project by building the image from the
1. Change to the root of your project directory.
2. Create the Django project by running the [docker-compose run](reference/run.md)
2. Create the Django project by running the [docker-compose run](../compose/reference/run.md)
command as follows.
```console
@ -184,7 +186,7 @@ In this section, you set up the database connection for Django.
3. Save and close the file.
4. Run the [docker-compose up](reference/up.md) command from the top level directory for your project.
4. Run the [docker-compose up](../compose/reference/up.md) command from the top level directory for your project.
```console
$ docker-compose up
@ -252,7 +254,7 @@ In this section, you set up the database connection for Django.
```
* Or, for a more elegant shutdown, switch to a different shell, and run
[docker-compose down](reference/down.md) from the top level of your
[docker-compose down](../compose/reference/down.md) from the top level of your
Django sample project directory.
```console
@ -270,9 +272,9 @@ In this section, you set up the database connection for Django.
## More Compose documentation
- [User guide](index.md)
- [Installing Compose](install.md)
- [Getting Started](gettingstarted.md)
- [Command line reference](reference/index.md)
- [Compose file reference](compose-file/index.md)
- [Sample apps with Compose](samples-for-compose.md)
- [Docker Compose overview](../compose/index.md)
- [Install Docker Compose](../compose/install.md)
- [Getting Started with Docker Compose](../compose/gettingstarted.md)
- [Docker Compose Command line reference](../compose/reference/index.md)
- [Compose file reference](../compose/compose-file/index.md)
- [Awesome Compose samples](https://github.com/docker/awesome-compose/){:target="_blank" rel="noopener" class="_"}

View File

@ -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

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 334 KiB

After

Width:  |  Height:  |  Size: 334 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -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" %}
@ -11,41 +15,37 @@ Learn how to develop and ship containerized applications, by walking through a
sample that exhibits canonical practices. These labs are from the [Docker Labs
repository]({{ labsbase }}).
| Sample | Description |
| ------ | ----------- |
| [Docker for Beginners]({{ labsbase }}/beginner/){: target="_blank"} | A good "Docker 101" course. |
| [Docker Swarm mode]({{ labsbase}}/swarm-mode){: target="_blank"} | Use Docker for natively managing a cluster of Docker Engines called a swarm. |
| [Configuring developer tools and programming languages]({{ labsbase }}/developer-tools/README.md){: target="_blank"} | How to set-up and use common developer tools and programming languages with Docker. |
| [Live Debugging Java with Docker]({{ labsbase }}/developer-tools/java-debugging){: target="_blank"} | Java developers can use Docker to build a development environment where they can run, test, and live debug code running within a container. |
| [Docker for Java Developers]({{ labsbase }}/developer-tools/java/){: target="_blank"} | Offers Java developers an intro-level and self-paced hands-on workshop with Docker. |
| [Live Debugging a Node.js application in Docker]({{ labsbase }}/developer-tools/nodejs-debugging){: target="_blank"} | Node developers can use Docker to build a development environment where they can run, test, and live debug code running within a container. |
| [Dockerizing a Node.js application]({{ labsbase }}/developer-tools/nodejs/porting/){: target="_blank"} | This tutorial starts with a simple Node.js application and details the steps needed to Dockerize it and ensure its scalability. |
| [Docker for ASP.NET and Windows containers]({{ labsbase }}/windows/readme.md){: target="_blank"} | Docker supports Windows containers, too! Learn how to run ASP.NET, SQL Server, and more in these tutorials. |
| [Docker Security]({{ labsbase }}/security/README.md){: target="_blank"} | How to take advantage of Docker security features. |
| [Building a 12-factor application with Docker]({{ labsbase}}/12factor){: target="_blank"} | Use Docker to create an app that conforms to Heroku's "12 factors for cloud-native applications." |
| Sample | Description |
| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [Docker for Beginners]({{ labsbase }}/beginner/){: target="_blank"} | A good "Docker 101" course. |
| [Docker Swarm mode]({{ labsbase}}/swarm-mode){: target="_blank"} | Use Docker for natively managing a cluster of Docker Engines called a swarm. |
| [Configuring developer tools and programming languages]({{ labsbase }}/developer-tools/README.md){: target="_blank"} | How to set-up and use common developer tools and programming languages with Docker. |
| [Live Debugging Java with Docker]({{ labsbase }}/developer-tools/java-debugging){: target="_blank"} | Java developers can use Docker to build a development environment where they can run, test, and live debug code running within a container. |
| [Docker for Java Developers]({{ labsbase }}/developer-tools/java/){: target="_blank"} | Offers Java developers an intro-level and self-paced hands-on workshop with Docker. |
| [Live Debugging a Node.js application in Docker]({{ labsbase }}/developer-tools/nodejs-debugging){: target="_blank"} | Node developers can use Docker to build a development environment where they can run, test, and live debug code running within a container. |
| [Dockerizing a Node.js application]({{ labsbase }}/developer-tools/nodejs/porting/){: target="_blank"} | This tutorial starts with a simple Node.js application and details the steps needed to Dockerize it and ensure its scalability. |
| [Docker for ASP.NET and Windows containers]({{ labsbase }}/windows/readme.md){: target="_blank"} | Docker supports Windows containers, too! Learn how to run ASP.NET, SQL Server, and more in these tutorials. |
| [Docker Security]({{ labsbase }}/security/README.md){: target="_blank"} | How to take advantage of Docker security features. |
| [Building a 12-factor application with Docker]({{ labsbase}}/12factor){: target="_blank"} | Use Docker to create an app that conforms to Heroku's "12 factors for cloud-native applications." |
## Sample applications
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. |
| [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. |
| [Django + PostgreSQL](../compose/django.md) | Run a Dockerized Django + PostgreSQL environment. |
| [PostgreSQL](../engine/examples/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. |
| [WordPress](../compose/wordpress.md) | Quickstart: Compose and WordPress. |
| Sample | Description |
| --------------------------------------------------------------| --------------------------------------------------------- |
| [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](aspnet-mssql-compose.md) | Run a Dockerized ASP.NET Core + SQL Server environment. |
| [CouchDB](couchdb_data_volumes.md) | Run a Dockerized CouchDB instance. |
| [Django + PostgreSQL](django.md) | Run a Dockerized Django + PostgreSQL environment. |
| [PostgreSQL](postgresql_service.md) | Run a Dockerized PostgreSQL instance. |
| [Rails + PostgreSQL](rails.md) | Run a Dockerized Rails + PostgreSQL environment. |
| [Riak](running_riak_service.md) | Run a Dockerized Riak instance. |
| [SSHd](running_ssh_service.md) | Run a Dockerized SSHd instance. |
| [WordPress](wordpress.md) | Quickstart: Compose and WordPress. |
## Library references
## Samples and documentation for official Docker images {#library-references}
The following table provides a list of popular official Docker images. For detailed documentation, select the specific image name.
| Image name | Description |
| ---------- | ----------- |
{% for page in site.samples %}| [{{ page.title }}](https://hub.docker.com/_/{{ page.title }}){: target="_blank"} | {{ page.description | strip }} |
{% endfor %}
For samples and detailed information about [official Docker images](../docker-hub/official_images.md),
refer to the documentation [for each image on Docker Hub](https://hub.docker.com/search?q=&type=image&image_filter=official){: target="_blank"}.

View File

@ -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

View File

@ -2,10 +2,12 @@
description: Getting started with Docker Compose and Rails
keywords: documentation, docs, docker, compose, orchestration, containers
title: "Quickstart: Compose and Rails"
redirect_from:
- /compose/rails/
---
This Quickstart guide shows you how to use Docker Compose to set up and run
a Rails/PostgreSQL app. Before starting, [install Compose](install.md).
a Rails/PostgreSQL app. Before starting, [install Compose](../compose/install.md).
### Define the project
@ -21,7 +23,7 @@ WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
COPY . /myapp
COPY ../compose /myapp
# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
@ -229,7 +231,7 @@ browser to see the Rails Welcome.
### Stop the application
To stop the application, run [docker-compose down](reference/down.md) in
To stop the application, run [docker-compose down](../compose/reference/down.md) in
your project directory. You can use the same terminal window in which you
started the database, or another one where you have access to a command prompt.
This is a clean way to stop the application.
@ -277,9 +279,9 @@ host.
## More Compose documentation
- [User guide](index.md)
- [Installing Compose](install.md)
- [Getting Started](gettingstarted.md)
- [Command line reference](reference/index.md)
- [Compose file reference](compose-file/index.md)
- [Sample apps with Compose](samples-for-compose.md)
- [Docker Compose overview](../compose/index.md)
- [Install Docker Compose](../compose/install.md)
- [Getting Started with Docker Compose](../compose/gettingstarted.md)
- [Docker Compose Command line reference](../compose/reference/index.md)
- [Compose file reference](../compose/compose-file/index.md)
- [Awesome Compose samples](https://github.com/docker/awesome-compose/){:target="_blank" rel="noopener" class="_"}

View File

@ -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

View File

@ -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

View File

@ -2,12 +2,14 @@
description: Getting started with Compose and WordPress
keywords: documentation, docs, docker, compose, orchestration, containers
title: "Quickstart: Compose and WordPress"
redirect_from:
- /compose/wordpress/
---
You can use Docker Compose to easily run WordPress in an isolated environment
built with Docker containers. This quick-start guide demonstrates how to use
Compose to set up and run WordPress. Before starting, make sure you have
[Compose installed](install.md).
[Compose installed](../compose/install.md).
### Define the project
@ -78,7 +80,7 @@ Compose to set up and run WordPress. Before starting, make sure you have
Now, run `docker-compose up -d` from your project directory.
This runs [`docker-compose up`](reference/up.md) in detached mode, pulls
This runs [`docker-compose up`](../compose/reference/up.md) in detached mode, pulls
the needed Docker images, and starts the wordpress and database containers, as shown in
the example below.
@ -134,7 +136,7 @@ browser.
### Shutdown and cleanup
The command [`docker-compose down`](reference/down.md) removes the
The command [`docker-compose down`](../compose/reference/down.md) removes the
containers and default network, but preserves your WordPress database.
The command `docker-compose down --volumes` removes the containers, default
@ -142,9 +144,9 @@ network, and the WordPress database.
## More Compose documentation
- [User guide](index.md)
- [Installing Compose](install.md)
- [Getting Started](gettingstarted.md)
- [Command line reference](reference/index.md)
- [Compose file reference](compose-file/index.md)
- [Sample apps with Compose](samples-for-compose.md)
- [Docker Compose overview](../compose/index.md)
- [Install Docker Compose](../compose/install.md)
- [Getting Started with Docker Compose](../compose/gettingstarted.md)
- [Docker Compose Command line reference](../compose/reference/index.md)
- [Compose file reference](../compose/compose-file/index.md)
- [Awesome Compose samples](https://github.com/docker/awesome-compose/){:target="_blank" rel="noopener" class="_"}