feat: Add support for compose devices mappings (#250)

* feat: Add support for compose `devices` mappings

https://docs.docker.com/reference/compose-file/services/#devices
```
services:
  foo:
    devices:
      - "/dev/ttyUSB0:/dev/ttyUSB0"
      - "/dev/sda:/dev/xvda:rwm"
```

* Lint fix
This commit is contained in:
Justin Bradford
2026-02-11 17:00:18 +00:00
committed by GitHub
parent 6e59657fe2
commit ab6f856987
9 changed files with 197 additions and 1 deletions
+4 -1
View File
@@ -83,10 +83,13 @@ func EvalContainerSpecChange(current api.ServiceSpec, new api.ServiceSpec) Conta
}
}
// Device reservations are immutable, so we'll need to recreate if any have changed
// Device reservations and mappings are immutable, so we'll need to recreate if any have changed
if !reflect.DeepEqual(current.Container.Resources.DeviceReservations, newResources.DeviceReservations) {
return ContainerNeedsRecreate
}
if !reflect.DeepEqual(current.Container.Resources.DeviceMappings, newResources.DeviceMappings) {
return ContainerNeedsRecreate
}
// Check if any mutable properties changed.
if !current.Caddy.Equals(new.Caddy) {