invalid MountType: "image"
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.7k
- Forks
- 676
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 6
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the shown docker stack deploy command and compose.yaml, then trace how the image volume mount is converted for swarm services before Docker Engine validation. Done means a service using type=image with the shown source, target, and subpath can be deployed successfully to a swarm cluster.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100