-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving of scratch volume image not possible: ImageError response from daemon: empty export - not implemented #38039
Comments
Error comes from here; Line 297 in 8e610b2
|
/cc @tonistiigi perhaps you know if there's a specific reason this was not implemented |
I guess it was for the |
Thanks @tonistiigi - makes sense @countzero wondering; is your example just an "example" or is that your actual use case? From your example, it looks like you're using "data containers" so that you can reference volumes. The concept of using "data containers" is really outdated, now that volume management commands are available; for example, to create a named volume for your logs;
That volume can then be attached to a container; docker run -d --volume mylogvolume:/var/log nginx:alpine Named volumes will also be automatically created on-the-fly if they don't exist, so running;
Will create a volume named |
@thaJeztah Your assumption is correct. I am currently refactoring "legacy" code that dates back to the time when Docker was not yet production ready (<v1.0). I am currently refactoring that code base and just replaced Interestingly the Docker CLI and behaviour, that was present before ~4 years still works as expected. The infrastructure I am working on is controlled with simple Bash scripts. Those could nowadays be replaced by Docker compose or Docker swarm or Kubernetes or... you get the point ;D |
I found this bug "in the wild" when I tried to use the Docker layer cache feature of the Bitbucket pipelines CI system. One of my Dockerfiles contains |
We used to create dockerfiles blindly assuming there is content, but that's not the case for virtual packages. Due to moby/moby#38039 we are forced for a "unpleasant" workaround, as we can't create empty FROM scratch images and export them.
Are there any plans into fixing this? I've bumped into this myself, and I find this behavior a bit "incoherent" : you can create images In my use case I use "data containers" because I'm using docker images to carry data, and in some corner cases I have "empty" images to push and pull from. I can't use volumes, because such images aren't necessarily supposed to be run. |
We used to create dockerfiles blindly assuming there is content, but that's not the case for virtual packages. Due to moby/moby#38039 we are forced for a "unpleasant" workaround, as we can't create empty FROM scratch images and export them.
Description
The
docker save
command will not save an image that contains only aFROM scratch
and aVOLUME
declaration. It fails with:Steps to reproduce the issue:
docker build -t emptyscratchvolume .
docker save
into a .tar fileDescribe the results you received:
It fails with:
Describe the results you expected:
The
docker save
command should produce a .tar file that will be compatible withdocker load
.Additional information you deem important (e.g. issue happens only occasionally):
The
docker save
command will work as expected if the image contains at least one file, like the Dockerfile itself:Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: