mirror of
				https://github.com/containers/podman.git
				synced 2025-10-30 17:38:27 +08:00 
			
		
		
		
	 fc6dcd12b3
			
		
	
	fc6dcd12b3
	
	
	
		
			
			We added the concept of image volumes in 2.2.0, to support inspecting an image from within a container. However, this is a strictly read-only mount, with no modification allowed. By contrast, the new `image` volume driver creates a c/storage container as its underlying storage, so we have a read/write layer. This, in and of itself, is not especially interesting, but what it will enable in the future is. If we add a new command to allow these image volumes to be committed, we can now distribute volumes - and changes to them - via a standard OCI image registry (which is rather new and quite exciting). Future work in this area: - Add support for `podman volume push` (commit volume changes and push resulting image to OCI registry). - Add support for `podman volume pull` (currently, we require that the image a volume is created from be already pulled; it would be simpler if we had a dedicated command that did the pull and made a volume from it) - Add support for scratch images (make an empty image on demand to use as the base of the volume) - Add UOR support to `podman volume push` and `podman volume pull` to enable both with non-image volume drivers Signed-off-by: Matthew Heon <matthew.heon@pm.me>
		
			
				
	
	
		
			93 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			93 lines
		
	
	
		
			2.9 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| package define
 | |
| 
 | |
| import (
 | |
| 	"bufio"
 | |
| 	"io"
 | |
| 	"regexp"
 | |
| 
 | |
| 	"github.com/containers/common/libnetwork/types"
 | |
| )
 | |
| 
 | |
| var (
 | |
| 	// DefaultSHMLockPath is the default path for SHM locks
 | |
| 	DefaultSHMLockPath = "/libpod_lock"
 | |
| 	// DefaultRootlessSHMLockPath is the default path for rootless SHM locks
 | |
| 	DefaultRootlessSHMLockPath = "/libpod_rootless_lock"
 | |
| 
 | |
| 	// NameRegex is a regular expression to validate container/pod names.
 | |
| 	// This must NOT be changed from outside of Libpod. It should be a
 | |
| 	// constant, but Go won't let us do that.
 | |
| 	NameRegex = types.NameRegex
 | |
| 	// RegexError is thrown in presence of an invalid container/pod name.
 | |
| 	RegexError = types.RegexError
 | |
| 	// UmaskRegex is a regular expression to validate Umask.
 | |
| 	UmaskRegex = regexp.MustCompile(`^[0-7]{1,4}$`)
 | |
| )
 | |
| 
 | |
| const (
 | |
| 	// DefaultTransport is a prefix that we apply to an image name
 | |
| 	// to check docker hub first for the image
 | |
| 	DefaultTransport = "docker://"
 | |
| )
 | |
| 
 | |
| // InfoData holds the info type, i.e store, host etc and the data for each type
 | |
| type InfoData struct {
 | |
| 	Type string
 | |
| 	Data map[string]interface{}
 | |
| }
 | |
| 
 | |
| // VolumeDriverLocal is the "local" volume driver. It is managed by libpod
 | |
| // itself.
 | |
| const VolumeDriverLocal = "local"
 | |
| 
 | |
| // VolumeDriverImage is the "image" volume driver. It is managed by Libpod and
 | |
| // uses volumes backed by an image.
 | |
| const VolumeDriverImage = "image"
 | |
| 
 | |
| const (
 | |
| 	OCIManifestDir  = "oci-dir"
 | |
| 	OCIArchive      = "oci-archive"
 | |
| 	V2s2ManifestDir = "docker-dir"
 | |
| 	V2s2Archive     = "docker-archive"
 | |
| )
 | |
| 
 | |
| // AttachStreams contains streams that will be attached to the container
 | |
| type AttachStreams struct {
 | |
| 	// OutputStream will be attached to container's STDOUT
 | |
| 	OutputStream io.WriteCloser
 | |
| 	// ErrorStream will be attached to container's STDERR
 | |
| 	ErrorStream io.WriteCloser
 | |
| 	// InputStream will be attached to container's STDIN
 | |
| 	InputStream *bufio.Reader
 | |
| 	// AttachOutput is whether to attach to STDOUT
 | |
| 	// If false, stdout will not be attached
 | |
| 	AttachOutput bool
 | |
| 	// AttachError is whether to attach to STDERR
 | |
| 	// If false, stdout will not be attached
 | |
| 	AttachError bool
 | |
| 	// AttachInput is whether to attach to STDIN
 | |
| 	// If false, stdout will not be attached
 | |
| 	AttachInput bool
 | |
| }
 | |
| 
 | |
| // JournaldLogging is the string conmon expects to specify journald logging
 | |
| const JournaldLogging = "journald"
 | |
| 
 | |
| // KubernetesLogging is the string conmon expects when specifying to use the kubernetes logging format
 | |
| const KubernetesLogging = "k8s-file"
 | |
| 
 | |
| // JSONLogging is the string conmon expects when specifying to use the json logging format
 | |
| const JSONLogging = "json-file"
 | |
| 
 | |
| // NoLogging is the string conmon expects when specifying to use no log driver whatsoever
 | |
| const NoLogging = "none"
 | |
| 
 | |
| // PassthroughLogging is the string conmon expects when specifying to use the passthrough driver
 | |
| const PassthroughLogging = "passthrough"
 | |
| 
 | |
| // DefaultRlimitValue is the value set by default for nofile and nproc
 | |
| const RLimitDefaultValue = uint64(1048576)
 | |
| 
 | |
| // BindMountPrefix distinguishes its annotations from others
 | |
| const BindMountPrefix = "bind-mount-options"
 |