Sign In | Join Free | My
Home >

docker expose

Product Categories
docker limited

docker expose

Country/Region china
Company docker limited
Update 2020-01-09 22:57:07
ICP License Issued by the Chinese Ministry
Contact Now

Compose file version 2 reference

Estimated reading time: 43 minutes

Reference and guidelines

These topics describe version 2 of the Compose file format.

Compose and Docker compatibility matrix

There are several versions of the Compose file format 1, 2, 2.x, and 3.x The table below is a quick look. For full details on what each version includes and how to upgrade, see About versions and upgrading.

This table shows which Compose file versions support specific Docker releases.

Compose file formatDocker Engine release

In addition to Compose file format versions shown in the table, the Compose itself is on a release schedule, as shown in Compose releases, but file format versions do not necessarily increment with each release. For example, Compose file format 3.0 was first introduced in Compose release 1.10.0, and versioned gradually in subsequent releases.

Service configuration reference

The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is ./docker-compose.yml.

Tip: You can use either a .yml or .yaml extension for this file. They both work.

A container definition contains configuration which are applied to each container started for that service, much like passing command-line parameters to docker run. Likewise, network and volume definitions are analogous to docker network create and docker volume create.

As with docker run, options specified in the Dockerfile, such as CMD, EXPOSE, VOLUME, ENV, are respected by default - you don’t need to specify them again in docker-compose.yml.

You can use environment variables in configuration values with a Bash-like ${VARIABLE} syntax - see variable substitution for full details.

This section contains a list of all configuration options supported by a service definition in version 2.


A set of configuration options to set block IO limits for this service.

version: "2.4" servicesfooimage: busybox blkio_configweight: 300 weight_device- path: /dev/sda weight: 400 device_read_bps- path: /dev/sdb rate: '12mb' device_read_iops- path: /dev/sdb rate: 120 device_write_bps- path: /dev/sdb rate: '1024k' device_write_iops- path: /dev/sdb rate: 30

device_read_bps, device_write_bps

Set a limit in bytes per second for read / write operations on a given device. Each item in the list must have two keys:

  • path, defining the symbolic path to the affected device
  • rate, either as an integer value representing the number of bytes or as a string expressing a byte value.

device_read_iops, device_write_iops

Set a limit in operations per second for read / write operations on a given device. Each item in the list must have two keys:

  • path, defining the symbolic path to the affected device
  • rate, as an integer value representing the permitted number of operations per second.


Modify the proportion of bandwidth allocated to this service relative to other services. Takes an integer value between 10 and 1000, with 500 being the default.


Fine-tune bandwidth allocation by device. Each item in the list must have two keys:

  • path, defining the symbolic path to the affected device
  • weight, an integer value between 10 and 1000


Configuration options that are applied at build time.

build can be specified either as a string containing a path to the build context, or an object with the path specified under context and optionally dockerfile and args.

build: ./dir buildcontext: ./dir dockerfile: Dockerfile-alternate argsbuildno: 1

If you specify image as well as build, then Compose names the built image with the webapp and optional tag specified in image:

build: ./dir image: webapp:tag

This results in an image named webapp and tagged tag, built from ./dir.


Added in version 2.2 file format

A list of images that the engine uses for cache resolution.


China Customized Inflatable Bumper Ball Game Bubble Adult Grass CE supplier

docker expose Images

Inquiry Cart 0
Send your message to this supplier
To: docker limited
Characters Remaining: (0/3000)