Skip to content

Compose config adds quotes to tmpfs size, docker rejects 'must be a integer' #9425

@carlhodder

Description

@carlhodder

Output from docker compose adds quote marks around tmpfs size parameter, and then docker rejects:

steps to reproduce:

  • docker compose -f example.yml config > interim.yml
  • cat <(echo "version: '3.9'") interim.yml > compiled.yml
  • docker stack deploy -c compiled.yml testing

Example config:

services:
  test:
    image: "nginx"
    ports:
      - "8080:8080"
    volumes:
        - type: tmpfs
          target: /dev/shm
          tmpfs:
              size: 512000000

Output from docker compose config:

name: backend
services:
  test:
    image: nginx
    networks:
      default: null
    ports:
    - mode: ingress
      target: 8080
      published: "8080"
      protocol: tcp
    volumes:
    - type: tmpfs
      target: /dev/shm
      tmpfs:
        size: **"512000000"**
networks:
  default:
    name: backend_default

docker stack -c {file} {destination} then fails with error:
services.test.volumes.1.tmpfs.size must be a integer

NOTE: Can supply non-bytes value, output is calculated to correct value in bytes and is quoted as a string.

Expected behaviour: Output from docker compose config is integer.

Version:
Docker: 20.10.14, build a224086

Docker info:
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.8.2)
compose: Docker Compose (Docker Inc., v2.4.1)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.17.0)
Server:
Containers: 4
Running: 4
Paused: 0
Stopped: 0
Images: 94
Server Version: 20.10.14
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: active
NodeID: 44pjigzt9pxjithhv3jmtn2cl
Is Manager: true
ClusterID: 2z407xi24syndhj1snfsm7mt7
Managers: 1
Nodes: 1
Default Address Pool: 10.0.0.0/8
SubnetSize: 24
Data Path Port: 4789
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 192.168.65.3
Manager Addresses:
192.168.65.3:2377
Runtimes: runc io.containerd.runc.v2 io.containerd.runtime.v1.linux
Default Runtime: runc
Init Binary: docker-init
containerd version: 3df54a852345ae127d1fa3092b95168e4a88e2f8
runc version: v1.0.3-0-gf46b6ba
init version: de40ad0
Security Options:
seccomp
Profile: default
Kernel Version: 5.10.102.1-microsoft-standard-WSL2
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 16
Total Memory: 24.98GiB
Name: docker-desktop
ID: OCXV:42LW:KJJZ:EQH5:XQQV:DEXW:MVL3:5FEB:IXTV:JPPD:UEPM:55PV
Docker Root Dir: /var/lib/docker
Debug Mode: false
HTTP Proxy: http.docker.internal:3128
HTTPS Proxy: http.docker.internal:3128
No Proxy: hubproxy.docker.internal
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
hubproxy.docker.internal:5000
127.0.0.0/8
Live Restore Enabled: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions