osbuild: add new org.osbuild.skopeo stage
Add bindings for the `org.osbuild.skopeo` that can be used to copy container images, accessed via the `org.osbuild.containers` input, into images. The constructor is designed with ease of use in mind and takes the needed container inputs and the storage path option, i.e. where to store the container in the images.
This commit is contained in:
parent
718b0c0c32
commit
f8804358a4
1 changed files with 31 additions and 0 deletions
31
internal/osbuild/skopeo_stage.go
Normal file
31
internal/osbuild/skopeo_stage.go
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package osbuild
|
||||
|
||||
type SkopeoDestination struct {
|
||||
Type string `json:"type"`
|
||||
StoragePath string `json:"storage-path,omitempty"`
|
||||
StorageDriver string `json:"sotrage-driver,omitempty"`
|
||||
}
|
||||
|
||||
type SkopeoStageOptions struct {
|
||||
Destination SkopeoDestination `json:"destination"`
|
||||
}
|
||||
|
||||
func (o SkopeoStageOptions) isStageOptions() {}
|
||||
|
||||
func NewSkopeoStage(images ContainersInput, path string) *Stage {
|
||||
|
||||
inputs := ContainersInputs{
|
||||
"images": images,
|
||||
}
|
||||
|
||||
return &Stage{
|
||||
Type: "org.osbuild.skopeo",
|
||||
Options: &SkopeoStageOptions{
|
||||
Destination: SkopeoDestination{
|
||||
Type: "containers-storage",
|
||||
StoragePath: path,
|
||||
},
|
||||
},
|
||||
Inputs: inputs,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue