moby / moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems
https://mobyproject.org/
Apache License 2.0
68.52k stars 18.63k forks source link

Support docker export on Windows #33581

Open dhirschfeld opened 7 years ago

dhirschfeld commented 7 years ago

Exporting a container on Windows seems to be explicitly disallowed:

if runtime.GOOS == "windows" {
    return fmt.Errorf("the daemon on this platform does not support export of a container")
}

https://github.com/moby/moby/blob/master/daemon/export.go#L16-L18

It would be good if this functionality were also available to Windows users.

fasihrana commented 7 years ago

Sorely need this. My images are 26GB in size!

bloodybeet commented 7 years ago

+1

vdemeester commented 7 years ago

/cc @jhowardmsft @jstarks @johnstep

lowenna commented 7 years ago

Yeah, we know ;) There are no imminent plans to support this though. Sorry.

dhirschfeld commented 7 years ago

It's a bit of a perfect storm because you can't export your image and squash doesn't work - #31468.

If this isn't likely to be supported in the near future it would be great if squash could be made to work on Windows.

friism commented 7 years ago

I know it may not be a perfect replacement for all use cases, but multi-stage builds do work on Windows and can achieve some of the same effects: https://docs.docker.com/engine/userguide/eng-image/multistage-build/

dhirschfeld commented 7 years ago

Yep, I'm using them and the do alleviate some of the image bloat issue.

alexivkin commented 6 years ago

@friism multistage only works for contained cases. consider this: COPY HugeInstaller.exe c:\ RUN c:\HugeInstaller.exe; rm c:\HugeInstaller.exe; is a perfect case for when squash works and multi-stage does not. That windows installer can be spraying changes all over the filesystem and registry hives, making the multistage COPY very big and fragile

mitchbte commented 5 years ago

Is there any news on support for this feature?? Definitely keen to reduce the size of some images... Come on guys it's an environmentally "green" feature, it should be at the top of the list. ;)

lowenna commented 5 years ago

I don’t think we can support this with the current graphdriver model and it’s limitations very easily. Hence, the answer is probably no for the indefinite future

judavi commented 5 years ago

@jhowardmsft please could you mentions some of limitations? I have been searching about the windowsfilter graphdriver but I haven't found good documentation. Will be interesting get an idea what are the blockers to make this works.

lowenna commented 5 years ago

It's been a long while since I looked at it, but IIRC, both this and squash rely on diffs between arbitrary layers which the platform itself can't support with the current implementation of the filterdriver in Windows itself.

renaudl commented 5 years ago

that's a shame, first thing I tried on my first windows container.

sdg002 commented 4 years ago

Same problem when I tried using docker export command "the daemon on this operating system does not support exporting Windows containers"

Is there an alternative? I am using docker image with MSSQL server and if I am not able to save state then I am not sure if there is anything practical I can do.

ohault commented 2 years ago

+1

hrvojesuta commented 5 months ago

+1