docker / docker/cli

Variable type conversion in Compose file breaks if service name contains dot

Open
#1,452 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/stack impact/compose-file
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

When using environment variables for integer or boolean types in a service definition, conversion will fail if the service name contains a dot (.) character.

Steps to reproduce the issue:

  1. Create the following docker-compose.yml file:
version: "3"
services:
  app.0:
    image: redis
    ulimits:
      nofile:
        soft: ${APP_NOFILE}
        hard: ${APP_NOFILE}
  1. Run docker stack deploy -c docker-compose.yml stk

Describe the results you received:

$ docker stack deploy -c docker-compose.yml stk
services.app.0.ulimits.nofile.hard must be a integer

Describe the results you expected:

Stack is deployed

Additional information you deem important (e.g. issue happens only occasionally):

Originally reported as a Compose issue: docker/compose#6279 ; realized while fixing that it applies to docker stack as well

Output of docker version:

$ docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:23:18 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:22:21 2018
  OS/Arch:          linux/amd64
  Experimental:     false

Output of docker info:

(irrelevant)

Additional environment details (AWS, VirtualBox, physical, etc.):

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the provided docker-compose.yml and the docker stack deploy -c docker-compose.yml stk command, using a dotted service name and environment-based integer values. Trace the stack deploy parsing and type-validation path to identify why the service name changes conversion, then verify that the stack deploys successfully with the same configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.