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

WSL compatibility

Open pseudotuga opened this issue 1 year ago • 0 comments

I'm using this script with success in an Unix environment but when I try it under WSL it simply didn't work.

> docker tag alpine:latest my_image:my_version
> python3 docker-copyedit.py from alpine:latest into my_image:my_version -vv set label author "real me"
WARNING:edit:output image is local (None)
INFO:edit:new load.tmp/data from docker save
WARNING:edit:done  new label 'author' real me
/home/tiago/workspace/docker-copyedit/docker-copyedit.py:715: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
  "created": datetime.datetime.utcnow().isoformat() + "Z"}]
INFO:edit:written new load.tmp/data/89fc417ed17a06fbdaecdd1558d7e80e90872211b1e9279370631b3c03489cdf.json
INFO:edit:removed old load.tmp/data/blobs/sha256/4048db5d36726e313ab8f7ffccf2362a34cba69e4cdd49119713483a68641fce

> docker inspect my_image:my_version | grep Label
            "Labels": null
> docker inspect my_image:my_version
[
    {
        "Id": "sha256:21dc6063fd678b478f57c0e13f47560d0ea4eeba26dfc947b2a4f81f686b9f45",
        "RepoTags": [
            "alpine:latest",
            "my_image:my_version"
        ],
        "RepoDigests": [
            "alpine@sha256:21dc6063fd678b478f57c0e13f47560d0ea4eeba26dfc947b2a4f81f686b9f45",
            "cebolas@sha256:21dc6063fd678b478f57c0e13f47560d0ea4eeba26dfc947b2a4f81f686b9f45"
        ],
        "Parent": "",
        "Comment": "buildkit.dockerfile.v0",
        "Created": "2024-12-05T12:49:04Z",
        "DockerVersion": "27.2.0",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "/bin/sh"
            ],
            "Image": "",
            "Volumes": null,
            "WorkingDir": "/",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": null
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 3655264,
        "GraphDriver": {
            "Data": null,
            "Name": "overlayfs"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:3e01818d79cd3467f1d60e54224f3f6ce5170eceb54e265d96bb82344b8c24e7"
            ]
        },
        "Metadata": {
            "LastTagTime": "2024-12-17T18:41:42.594909552Z"
        }
    }
]

On unix:

❯ docker inspect my_image:my_version
[
    {
        "Id": "sha256:54c82cff525076567cee212a52c25d99bcd7b805006f9adfaa978fde7abfe6b1",
        "RepoTags": [
            "my_image:my_version"
        ],
        "RepoDigests": [],
        "Parent": "",
        "Comment": "",
        "Created": "2024-12-05T12:49:04Z",
        "DockerVersion": "",
        "Author": "",
        "Config": {
            "Hostname": "",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "/bin/sh"
            ],
            "Image": "",
            "Volumes": null,
            "WorkingDir": "/",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {
                "author": "real me"
            }
        },
        "Architecture": "amd64",
        "Os": "linux",
        "Size": 7832877,
        "GraphDriver": {
            "Data": {
                "MergedDir": "/var/lib/docker/overlay2/d093280b7c760191d2ee7ca46fe9f69a46188c648b0c6a31a2b483cf16630955/merged",
                "UpperDir": "/var/lib/docker/overlay2/d093280b7c760191d2ee7ca46fe9f69a46188c648b0c6a31a2b483cf16630955/diff",
                "WorkDir": "/var/lib/docker/overlay2/d093280b7c760191d2ee7ca46fe9f69a46188c648b0c6a31a2b483cf16630955/work"
            },
            "Name": "overlay2"
        },
        "RootFS": {
            "Type": "layers",
            "Layers": [
                "sha256:3e01818d79cd3467f1d60e54224f3f6ce5170eceb54e265d96bb82344b8c24e7"
            ]
        },
        "Metadata": {
            "LastTagTime": "0001-01-01T00:00:00Z"
        }
    }
]

pseudotuga avatar Dec 18 '24 11:12 pseudotuga