Skip to content

Commit

Permalink
add documentation on imagestore and add a warning if set
Browse files Browse the repository at this point in the history
  • Loading branch information
kannon92 committed Aug 25, 2023
1 parent 6902c2d commit b0fb599
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/containers-storage.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ $ restorecon -R -v /NEWSTORAGEPATH
A common use case for this field is to provide a local storage directory when user home directories are NFS-mounted (podman does not support container storage over NFS).

**imagestore**=""
image storage path (default is assumed to be same as `graphroot`).
Path of imagestore different from `graphroot`, by default storage library stores all images in `graphroot` but if `imagestore` is provided it will store newly pulled images in provided `imagestore` but will keep using `graphroot` for everything else. If user is using `overlay` driver then images which were already part of `graphroot` will still be accessible ( Internally storage library will mount `graphroot` as an `additionalImageStore` to allow this behaviour ).

A common use case for this field is for the users who want to split the file-system in different parts i.e disk which stores images vs disk used by the container created by the image.

Imagestore must be different from `graphroot`.

**runroot**=""
container storage run dir (default: "/run/containers/storage")
Default directory to store all temporary writable content created by container storage programs. The rootless runroot path supports environment variable substitutions (ie. `$HOME/containers/storage`)
Expand Down
5 changes: 5 additions & 0 deletions storage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ runroot = "/run/containers/storage"
# restorecon -R -v /NEWSTORAGEPATH
graphroot = "/var/lib/containers/storage"

# Optional value for image storage location
# If set must be different than graphroot.

# imagestore =


# Storage path for rootless users
#
Expand Down
4 changes: 4 additions & 0 deletions storage.conf-freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ runroot = "/var/run/containers/storage"
# Primary Read/Write location of container storage
graphroot = "/var/db/containers/storage"

# Optional value for image storage location
# If set must be different than graphroot.

# imagestore =

# Storage path for rootless users
#
Expand Down
4 changes: 4 additions & 0 deletions types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ func defaultStoreOptionsIsolated(rootless bool, rootlessUID int, storageConf str
storageOpts.RootlessStoragePath = storagePath
}

if storageOpts.ImageStore != "" && storageOpts.ImageStore == storageOpts.GraphRoot {
return storageOpts, fmt.Errorf("imagestore if set must be a different location than graphroot")
}

return storageOpts, nil
}

Expand Down

0 comments on commit b0fb599

Please sign in to comment.