Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ exclude: ["_scripts", "apidocs/layouts", "Gemfile", "hooks", "index.html", "404.
latest_engine_api_version: "1.40"
docker_ce_version: "19.03"
docker_ee_version: "19.03"
compose_version: "1.25.4"
compose_file_v3: "3.7"
compose_version: "1.25.5"
compose_file_v3: "3.8"
compose_file_v2: "2.4"
machine_version: "0.16.0"
distribution_version: "2.7"
Expand Down
4 changes: 2 additions & 2 deletions _config_authoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ exclude: ["_scripts", "apidocs/layouts", "Gemfile", "hooks", "index.html", "404.
latest_engine_api_version: "1.40"
docker_ce_version: "19.03"
docker_ee_version: "19.03"
compose_version: "1.25.4"
compose_file_v3: "3.7"
compose_version: "1.25.5"
compose_file_v3: "3.8"
compose_file_v2: "2.4"
machine_version: "0.16.0"
distribution_version: "2.7"
Expand Down
4 changes: 2 additions & 2 deletions _data/toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,10 +1100,10 @@ manuals:
title: Getting started
- path: /compose/swarm/
title: Using Compose with Swarm
- path: /compose/env-file/
title: Environment file
- path: /compose/environment-variables/
title: Environment variables in Compose
- path: /compose/env-file/
title: Environment file
- path: /compose/extends/
title: Extend services in Compose
- path: /compose/networking/
Expand Down
1 change: 1 addition & 0 deletions _includes/content/compose-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ This table shows which Compose file versions support specific Docker releases.

| **Compose file format** | **Docker Engine release** |
| ------------------- | ------------------ |
| 3.8 | 19.03.0+ |
| 3.7 | 18.06.0+ |
| 3.6 | 18.02.0+ |
| 3.5 | 17.12.0+ |
Expand Down
23 changes: 23 additions & 0 deletions compose/compose-file/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,29 @@ services:
replicas: 6
```

#### max_replicas_per_node

If the service is `replicated` (which is the default), [limit the number of replicas](/engine/reference/commandline/service_create.md#specify-maximum-replicas-per-node---replicas-max-per-node)
that can run on an node at any time.

> **[Version 3.8](compose-versioning.md#version-3) and above.**

When there are more tasks requested than running nodes, an error `no suitable node (max replicas per node limit exceed)` is raised.

```yaml
version: "{{ site.compose_file_v3 }}"
services:
worker:
image: dockersamples/examplevotingapp_worker
networks:
- frontend
- backend
deploy:
mode: replicated
replicas: 6
max_replicas_per_node: 1
```

#### resources

Configures resource constraints.
Expand Down
67 changes: 37 additions & 30 deletions compose/django.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,27 @@ and a `docker-compose.yml` file. (You can use either a `.yml` or `.yaml` extensi
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.
9. Add the following configuration to the file.

```none
version: '3'

services:
db:
image: postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
version: '3'

services:
db:
image: postgres
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
```

This file defines two services: The `db` service and the `web` service.
Expand Down Expand Up @@ -138,21 +142,24 @@ In this section, you set up the database connection for Django.

1. In your project directory, edit the `composeexample/settings.py` file.

2. Replace the `DATABASES = ...` with the following:

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
'PORT': 5432,
}
}

These settings are determined by the
[postgres](https://hub.docker.com/_/postgres) Docker image
specified in `docker-compose.yml`.
2. Replace the `DATABASES = ...` with the following:

# setting.py

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': 'db',
'PORT': 5432,
}
}

These settings are determined by the
[postgres](https://hub.docker.com/_/postgres) Docker image
specified in `docker-compose.yml`.

3. Save and close the file.

Expand Down
4 changes: 2 additions & 2 deletions compose/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ production. These changes may include:
- Removing any volume bindings for application code, so that code stays inside
the container and can't be changed from outside
- Binding to different ports on the host
- Setting environment variables differently, such as when you need to decrease the verbosity of
logging, or to enable email sending)
- Setting environment variables differently, such as reducing the verbosity of
logging, or to specify settings for external services such as an email server
- Specifying a restart policy like `restart: always` to avoid downtime
- Adding extra services such as a log aggregator

Expand Down
11 changes: 11 additions & 0 deletions compose/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ redirect_from:
- /release-notes/docker-compose/
---

## 1.25.5
(2020-04-10)

### Features

- Bumped OpenSSL from 1.1.1d to 1.1.1f.

- Added Compose version 3.8.

- Limited service scale to the size specified by the field `deploy.placement.max_replicas_per_node`.

## 1.25.4
(2020-02-03)

Expand Down
9 changes: 9 additions & 0 deletions config/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ docker inspect --format '{{join .Args " , "}}' container
```
{% endraw %}

## table

`table` specifies which fields you want to see its output.

{% raw %}
```
docker image list --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}"
```
{% endraw %}

## json

Expand Down
2 changes: 1 addition & 1 deletion docker-hub/webhooks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Docker Hub Webhooks
keywords: Docker, webhookds, hub, builds
keywords: Docker, webhooks, hub, builds
title: Docker Hub Webhooks
---

Expand Down
2 changes: 1 addition & 1 deletion ee/ucp/kubernetes/storage/use-nfs-volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
To deploy the pod, and ensure that it started up correctly, use the [kubectl](../../user-access/kubectl/) command line tool.

```bash
$ kubectl create -f nfsinapod.yaml
$ kubectl create -f nfs-in-a-pod.yaml

$ kubectl get pods
NAME READY STATUS RESTARTS AGE
Expand Down
4 changes: 2 additions & 2 deletions engine/examples/dotnetcore.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tutorial](https://www.asp.net/get-started) to initialize a project or clone our
the `Dockerfile` to use the DLL file of your project.

```dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
Expand All @@ -54,7 +54,7 @@ COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "aspnetapp.dll"]
Expand Down
4 changes: 2 additions & 2 deletions engine/install/debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ To get started with Docker Engine on Debian, make sure you
To install Docker Engine, you need the 64-bit version of one of these Debian or
Raspbian versions:

- Ubuntu Buster 10 (stable)
- Ubuntu Stretch 9 / Raspbian Stretch
- Debian Buster 10 (stable)
- Debian Stretch 9 / Raspbian Stretch

Docker Engine is supported on `x86_64` (or `amd64`), `armhf`, and `arm64` architectures.

Expand Down
2 changes: 1 addition & 1 deletion engine/swarm/configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ However, the `configs` key is not supported for `docker compose`. See

This simple example shows how configs work in just a few commands. For a
real-world example, continue to
[Intermediate example: Use configs with a Nginx service](#advanced-example-use-configs-with-a-nginx-service).
[Advanced example: Use configs with a Nginx service](#advanced-example-use-configs-with-a-nginx-service).

1. Add a config to Docker. The `docker config create` command reads standard
input because the last argument, which represents the file to read the
Expand Down