Signed-off-by: John Howard <jhoward@microsoft.com>
| ... | ... |
@@ -13,15 +13,15 @@ import ( |
| 13 | 13 |
// ContainerExport writes the contents of the container to the given |
| 14 | 14 |
// writer. An error is returned if the container cannot be found. |
| 15 | 15 |
func (daemon *Daemon) ContainerExport(name string, out io.Writer) error {
|
| 16 |
- if runtime.GOOS == "windows" {
|
|
| 17 |
- return fmt.Errorf("the daemon on this platform does not support export of a container")
|
|
| 18 |
- } |
|
| 19 |
- |
|
| 20 | 16 |
container, err := daemon.GetContainer(name) |
| 21 | 17 |
if err != nil {
|
| 22 | 18 |
return err |
| 23 | 19 |
} |
| 24 | 20 |
|
| 21 |
+ if runtime.GOOS == "windows" && container.Platform == "windows" {
|
|
| 22 |
+ return fmt.Errorf("the daemon on this platform does not support exporting Windows containers")
|
|
| 23 |
+ } |
|
| 24 |
+ |
|
| 25 | 25 |
data, err := daemon.containerExport(container) |
| 26 | 26 |
if err != nil {
|
| 27 | 27 |
return fmt.Errorf("Error exporting container %s: %v", name, err)
|