Skip to content

[BUG] error decoding 'memswap_limit': invalid size: '-1' since 2.23.0 #11160

@maaarghk

Description

@maaarghk

Description

"error decoding 'memswap_limit': invalid size: '-1'"

Steps To Reproduce

services:
  service:
    [...]
    memswap_limit: -1

Compose Version

2.23.0

Docker Environment

Client:
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.11.2
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  2.23.0
    Path:     /usr/lib/docker/cli-plugins/docker-compose

Server:
 Containers: 36
  Running: 2
  Paused: 0
  Stopped: 34
 Images: 430
 Server Version: 24.0.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8c087663b0233f6e6e2f4515cee61d49f14746a8.m
 runc version: 
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.5.9-1-MANJARO
 Operating System: Manjaro Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 62.55GiB
 Name: 
 ID: 
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Default Address Pools:
   Base: 172.24.0.1/13, Size: 25

Anything else?

spec still says this is valid albeit deprecated

https://github.com/compose-spec/compose-spec/blob/master/spec.md?plain=1#L1488
https://github.com/compose-spec/compose-spec/blob/master/05-services.md?plain=1#L1277

tbh although I've personally just removed my usage of it, which I suspect was copy-pasted off some shit blog, it's still an undocumented breaking change and might be a sign of some other deeper issue with more important consequences?

(docker run --memory-swap=-1 appears to still work)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions