@@ -58,6 +58,8 @@ pub enum Transport {
58
58
OciDir ,
59
59
/// A local OCI archive tarball (`oci-archive:`)
60
60
OciArchive ,
61
+ /// A local Docker archive tarball (`docker-archive:`)
62
+ DockerArchive ,
61
63
/// Local container storage (`containers-storage:`)
62
64
ContainerStorage ,
63
65
/// Local directory (`dir:`)
@@ -107,6 +109,7 @@ impl TryFrom<&str> for Transport {
107
109
Self :: REGISTRY_STR | "docker" => Self :: Registry ,
108
110
Self :: OCI_STR => Self :: OciDir ,
109
111
Self :: OCI_ARCHIVE_STR => Self :: OciArchive ,
112
+ Self :: DOCKER_ARCHIVE_STR => Self :: DockerArchive ,
110
113
Self :: CONTAINERS_STORAGE_STR => Self :: ContainerStorage ,
111
114
Self :: LOCAL_DIRECTORY_STR => Self :: Dir ,
112
115
o => return Err ( anyhow ! ( "Unknown transport '{}'" , o) ) ,
@@ -117,6 +120,7 @@ impl TryFrom<&str> for Transport {
117
120
impl Transport {
118
121
const OCI_STR : & ' static str = "oci" ;
119
122
const OCI_ARCHIVE_STR : & ' static str = "oci-archive" ;
123
+ const DOCKER_ARCHIVE_STR : & ' static str = "docker-archive" ;
120
124
const CONTAINERS_STORAGE_STR : & ' static str = "containers-storage" ;
121
125
const LOCAL_DIRECTORY_STR : & ' static str = "dir" ;
122
126
const REGISTRY_STR : & ' static str = "registry" ;
@@ -127,6 +131,7 @@ impl Transport {
127
131
Transport :: Registry => Self :: REGISTRY_STR ,
128
132
Transport :: OciDir => Self :: OCI_STR ,
129
133
Transport :: OciArchive => Self :: OCI_ARCHIVE_STR ,
134
+ Transport :: DockerArchive => Self :: DOCKER_ARCHIVE_STR ,
130
135
Transport :: ContainerStorage => Self :: CONTAINERS_STORAGE_STR ,
131
136
Transport :: Dir => Self :: LOCAL_DIRECTORY_STR ,
132
137
}
@@ -247,6 +252,7 @@ impl std::fmt::Display for Transport {
247
252
// TODO once skopeo supports this, canonicalize as registry:
248
253
Self :: Registry => "docker://" ,
249
254
Self :: OciArchive => "oci-archive:" ,
255
+ Self :: DockerArchive => "docker-archive:" ,
250
256
Self :: OciDir => "oci:" ,
251
257
Self :: ContainerStorage => "containers-storage:" ,
252
258
Self :: Dir => "dir:" ,
@@ -502,6 +508,7 @@ mod tests {
502
508
Transport :: Registry ,
503
509
Transport :: ContainerStorage ,
504
510
Transport :: OciArchive ,
511
+ Transport :: DockerArchive ,
505
512
Transport :: OciDir ,
506
513
] {
507
514
assert_eq ! ( Transport :: try_from( v. serializable_name( ) ) . unwrap( ) , v) ;
@@ -551,6 +558,11 @@ mod tests {
551
558
transport : Transport :: OciArchive ,
552
559
name : "/path/to/foo.ociarchive" ,
553
560
} ,
561
+ Case {
562
+ s : "docker-archive:/path/to/foo.dockerarchive" ,
563
+ transport : Transport :: DockerArchive ,
564
+ name : "/path/to/foo.dockerarchive" ,
565
+ } ,
554
566
Case {
555
567
s : "containers-storage:localhost/someimage:blah" ,
556
568
transport : Transport :: ContainerStorage ,
0 commit comments