Skip to content

Add "name" field to secrets and configs to allow interpolation in Compose files #667

Closed

Description

@ilyasotkov

In Compose file version 3.4, volumes gained the "name" field which allowed the volumes' names to be interpolated for simple version bumps using environmental variables.

That feature is also needed for secrets and configs. Usage example:

version: "3.5" # future version

secrets:
  my-secret:
    name: my-secret-${VERSION} # name of the Docker Secret with variable interpolation
    file: ./secret.html

configs:
  my-config:
    name: my-config-${VERSION} # same thing for configs
    file: ./default.conf

services:
  web:
    image: nginx:1.13.5-alpine
    ports:
      - "80:80"
    secrets:
      - source: my-secret # reference by the name of the key, consistent with how it is for volumes now in 3.4
        target: /usr/share/nginx/html/index.html
    configs:
      - source: my-config
        target: /etc/nginx/conf.d/default.conf

I'll add a pull request for the feature shortly.

Activity

  1. changed the title [-]Add secret.name and config.name to allow interpolation[/-] [+]Add "name" field to secrets and configs to allow interpolation[/+] on Nov 6, 2017
  2. changed the title [-]Add "name" field to secrets and configs to allow interpolation[/-] [+]Add "name" field to secrets and configs to allow interpolation in Compose files[/+] on Nov 6, 2017
  3. ilyasotkov commented on Nov 6, 2017

    @ilyasotkov
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions