swarmkit icon indicating copy to clipboard operation
swarmkit copied to clipboard

invalid MountType: "image"

Open 0x6d68 opened this issue 11 months ago • 1 comments

Deploying to a swarm cluster does not work with volume type=image.

docker -H ssh://swarm.lan stack deploy -c compose.yaml test

Got: failed to create service test_with_image: Error response from daemon: invalid MountType: "image".

services:
  with_image:
    image: alpine
    command: "sleep 3600"
    deploy:
      replicas: 1
    volumes:
      - type: image
        source: nginx:alpine
        target: /mnt/image
        image:
          subpath: usr/share/nginx/html/  # https://github.com/moby/swarmkit/issues/3182
               
Client: Docker Engine - Community
 Version:           28.1.1
 API version:       1.49
 Go version:        go1.23.8
 Git commit:        4eba377
 Built:             Fri Apr 18 09:52:57 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.1.1
  API version:      1.49 (minimum version 1.24)
  Go version:       go1.23.8
  Git commit:       01f442b
  Built:            Fri Apr 18 09:52:57 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.27
  GitCommit:        05044ec0a9a75232cad458027ca83437aae3f4da
 runc:
  Version:          1.2.5
  GitCommit:        v1.2.5-0-g59923ef
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

0x6d68 avatar Apr 18 '25 13:04 0x6d68

It seems that support for volume type image is not implemented to Swarm. Need to be added similarly like I added npipe support in #2691 and related PRs in moby/moby and docker/cli

olljanat avatar May 15 '25 14:05 olljanat