Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Add instructions for docker-compose.yml #9

Open
lpalgarvio opened this issue Oct 18, 2016 · 4 comments
Open

Add instructions for docker-compose.yml #9

lpalgarvio opened this issue Oct 18, 2016 · 4 comments

Comments

@lpalgarvio
Copy link

lpalgarvio commented Oct 18, 2016

As per
https://docs.docker.com/compose/compose-file/

Example:

--
version: '2'
services:
  test:
    labels:
      - "org.label-schema.schema-version=1.0"
      - "org.label-schema.name=e.g. Example project name"
      - "org.label-schema.description=Example project description in 300 chars or less"
      - "org.label-schema.vendor=e.g. ACME Inc"
      - "org.label-schema.url=e.g. https://www.example.com/"
      - "org.label-schema.vcs-ref=$VCS_REF"
      - "org.label-schema.vcs-url=e.g. https://github.com/microscaling/microscaling"
      - "org.label-schema.version=$VERSION"
      - "org.label-schema.build-date=$BUILD_DATE"
@rossf7
Copy link
Contributor

rossf7 commented Oct 21, 2016

Thanks for raising this and I did some experimenting with the label support in Compose. These labels are added to the containers created by Compose. But they aren't added to any images built by Compose. To add labels to an image you need to add them in the Dockerfile.

V1 of label schema only covers build time labels. But runtime labels will be covered in a future version.

I like the idea of having a page with how to use label schema with widely used tools like Compose.

@lpalgarvio
Copy link
Author

There is an issue for this in Docker Compose,
docker/compose#4038

The Docker Compose YAML file allows for building images with it, but is omitting the labels for images it builds, even though labels for Volumes and Networks are already supported.

@lpalgarvio
Copy link
Author

lpalgarvio commented May 24, 2017

Proposal: Support for building images with labels #4038 is fixed.
This can now be implemented in the next Docker Compose 1.14 version, probably only for Docker Compose format version 3.0 or higher.

Support for Composer format 2.x is pending.
Add support for build labels in 2.1 and 2.2 format #4863

@lpalgarvio
Copy link
Author

This last issue has been fixed and closed.
Add support for build labels in 2.1 and 2.2 format #4863

Labels can now be included in composer files for any kind of resource, including for builds.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants