Skip to content

Reuse docker-compose labels #97

@bersace

Description

@bersace

Hi,

In my use case, I avoid exposing ports and prefer .docker resolution to launch several instances of compose project. This require to export an env var and reuse it as region in dnsdock.

# .envrc
export COMPOSE_PROJECT_NAME=dev
version: '3'
services:
  app:
    labels:
      com.dnsdock.region: ${COMPOSE_PROJECT_NAME}
      com.dnsdock.name: app

What do you think of falling back label com.dnsdock.region to com.docker.compose.project and label com.dnsdock.name to com.docker.compose.service ?

This allow to resolve service as close as possible to compose structure :

$ getent hosts app.$COMPOSE_PROJECT_NAME.docker
172.23.0.4      app.compose.docker
$

Thanks for dnsdock, it's a lot easier than playing with ports !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions