28

I am trying to save a docker image in windows so that I can load to another Linux box,in between while saving the images in windows, I got an error stating access is denied to rename the docker temp file.

I checked the permission everything looks fine, in fact I can able to edit. Any help here is highly appreciable. I am using docker 1.11.0

docker save -o . <imgID>
rename .docker_temp_742575903 .: Access is denied.
lambodar
  • 3,495
  • 5
  • 34
  • 58

4 Answers4

41

Never mind, along with path I need to give my new file name that docker wanted to create and it don't happen implicitly, in my cases I gave

docker save -o ./<tar name that you wanted docker to create> <imgID>
lambodar
  • 3,495
  • 5
  • 34
  • 58
  • 1
    me too had same problem...solution is to give file name as well Eg `C:\build\images\image_file_Name` name would be anything you wish – 1234 Sep 26 '18 at 21:32
  • 1
    I provided the path and file name but I still get the error "open c:\.docker_temp_916058883: Access is denied." – DarioN1 Jan 02 '19 at 16:26
  • Check if write permission is there for the corresponding user. Usually C drive is for system files trying providing different path. – lambodar Jan 03 '19 at 11:05
  • I have the same problem as @DarioN1 – Chris Holland Feb 19 '19 at 11:03
  • 2
    edit: @DarioN1 I was able to resolve this issue (using docker toolbox). In the virtual box interface for the docker vm there's an option shared folders where I added a path. Then I went to that folder using the docker console and saved via `docker save > file.tar` – Chris Holland Feb 19 '19 at 11:23
  • This worked for me, first time docker user. thanks! Wish the error messages were more user friendly. – yonikawa Jan 25 '22 at 23:36
11

For the similar issue but on unix:

root@linux:/opt/docker# docker save -o ./presto.tar starburstdata/presto
open .docker_temp_359214587: permission denied

You can use different syntax to save the image as a workaround:

root@linux:/opt/docker# docker save starburstdata/presto > presto.tar
root@linux:/opt/docker# ls -l
razem 1356196
-rw-r--r-- 1 root root 1388737024 maj 23 11:16 presto.tar
Mateusz Wicher
  • 152
  • 1
  • 4
  • Thanks. This does help get past the Linux 'permission denied' error. My one concern is that the `-o` flag is omitted. Does it still create a viable restoration file? – mOrloff Aug 15 '19 at 00:25
8

I workaround the problem on linux by changing the current forlder permission to 777. Make sure your current direct :

mkdir ~/docker-images
cd ~/docker-images
chmod 777 ./
sudo docker save <img_id> -o ./<filename>
Haniel
  • 81
  • 1
  • 1
0

You are not giving image name and it's creating some temp name by default but, while renaming that it's throwing error. you can use this command to solve this problem.

docker save -o <some custom name with path> <imgID or REPOSITORY:TAG>

something like this if you want to create in present directory

docker save -o ./ubuntu_image.tar ubuntu:latest
or
docker save -o ./ubuntu_image.tar eat546t

If you want to create in specific location

docker save -o path/of/image/ubuntu_image.tar ubuntu:latest
Raushan Kumar
  • 121
  • 1
  • 2