mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-16 05:12:04 +00:00
[PR #12] [MERGED] Capture image VOLUME declarations #14
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/12
Author: @JBailes
Created: 4/17/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @JBailes
Base:
docker-lxc-daemon← Head:aimee/session/portainer-image-volumes📝 Commits (10+)
a919b16Capture image VOLUME declarations5b1fa8dInherit image Volumes into container inspectc59e313Support Dockerfile SHELL and named-volume mount inspectb5a9b90Round-trip modern HostConfig fields through inspect5e5dda2Round-trip endpoint IPAM and inherit container Config.Shellc3d1c8eEnrich NetworkSettings on container inspect349fa58Track PreCPUStats across stats samples7a5d8adRead memory.peak and memory.events for stats47262f9Persist HostConfig.Devices and DeviceCgroupRulese9f28fbRound-trip more HostConfig fields📊 Changes
9 files changed (+581 additions, -78 deletions)
View changed files
📝
internal/api/build.go(+54 -2)📝
internal/api/containers.go(+228 -26)📝
internal/api/containers_extra.go(+114 -3)📝
internal/api/images.go(+29 -1)📝
internal/api/system.go(+1 -0)📝
internal/api/types.go(+77 -28)📝
internal/lxc/manager.go(+6 -0)📝
internal/oci/pull.go(+12 -0)📝
internal/store/store.go(+60 -18)📄 Description
Summary
Capture images' declared VOLUMEs so Portainer's "Image > Volumes" tab renders, and Compose manifests built from VOLUME-carrying images see the declaration preserved.
Why
Images declare
VOLUME /pathto signal to Docker (and to Compose's anonymous-volume generator) that a path should be backed by a dedicated volume when the container starts. Portainer displays this on the image detail page. We were dropping the field end-to-end:oci.Pulldidn't readconfig.Volumesfrom the OCI manifest.VOLUMEas an unknown instruction./images/{name}/json'sConfigblock had noVolumesfield.What changed
oci.ImageConfiggets aVolumes []string;oci.Pullreadsconfig.Volumesfrom the manifest config JSON.store.ImageRecordpersists it asOCIVolumes;pullOCIpopulates both the AddImage call and the oci-meta.json sidecar.VOLUME(shell formVOLUME /a /band JSON array formVOLUME ["/a","/b"]) via a smallparseVolumeInstructionhelper and attaches the set to the built image.api.ImageConfiggainsVolumes map[string]struct{}(omitempty);imageConfigFromRecordmaterialises it for inspect.Validation
Built on a transient daemon socket on
root@192.168.1.253:POST /images/create?fromImage=postgres&tag=16followed by inspect returnsConfig.Volumes = {"/var/lib/postgresql/data": {}}(and preserves the unrelatedStopSignal = "SIGINT"previously captured).Config.Volumesis{"/cache":{}, "/data":{}, "/logs":{}}. Both the JSON array and shell forms are parsed.Notes
docker-lxc-daemonafter PR #10 merged; independent of the in-flight PR #11 (image save/load) — no file overlap.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.