docker-copyedit icon indicating copy to clipboard operation
docker-copyedit copied to clipboard

Manifest file already exists

Open mariofreeze opened this issue 4 years ago • 2 comments

Hi Guido,

I wanted to remove the /database volume from the ibmcom/db2 image. But when I process it with your script using: docker-copyedit.py FROM ibmcom/db2:latest INTO db2:1.0 REMOVE ALL VOLUMES I get the error that the manifest file already exists: Traceback (most recent call last): File "docker-copyedit.py", line 929, in <module> edit_image(inp, out, commands) File "docker-copyedit.py", line 301, in edit_image changed = edit_datadir(datadir, out_tag, edits) File "docker-copyedit.py", line 723, in edit_datadir os.rename(manifest_filename + ".tmp", manifest_filename) FileExistsError: [WinError 183] Eine Datei kann nicht erstellt werden, wenn sie bereits vorhanden ist: 'load.tmp\\data\\manifest.json.tmp' -> 'load.tmp\\data\\manifest.json'

I tried to fix it but I'am a novice to python.

Thanks Mario

mariofreeze avatar Aug 16 '21 16:08 mariofreeze

Please try to change "if podman()" on line 720 into "if True".

gdraheim avatar Aug 16 '21 16:08 gdraheim

Finally I got beyond this rename by adding these lines before 723:

        if os.path.isfile(manifest_filename + ".old"):
            os.remove(manifest_filename + ".old")
        if True:
            os_jsonfile(manifest_filename)
            os.rename(manifest_filename, manifest_filename + ".old")

mariofreeze avatar Aug 17 '21 15:08 mariofreeze

in v1.4.6097

gdraheim avatar May 15 '23 23:05 gdraheim