python-rye icon indicating copy to clipboard operation
python-rye copied to clipboard

As of 9.3.0 the Docker images no longer specify a user.

Open Kugeleis opened this issue 10 months ago • 9 comments

This is not needed anymore

Kugeleis avatar Mar 01 '25 08:03 Kugeleis

@Kugeleis Thank you for creating the PR! If the user is not specified, as seen here, it will default to root privileges, which is not ideal from a security perspective. Therefore, I believe this PR is not appropriate. What do you think?

a5chin avatar Mar 01 '25 12:03 a5chin

I can only tell it did not work with the chown in that line. The fix was to remove it.

Kugeleis avatar Mar 02 '25 07:03 Kugeleis

I investigated, and it seems that the chown option is still supported in the latest version of Docker. https://docs.docker.com/reference/dockerfile/#copy---chown---chmod

By the way, what exactly is version 9.3.0 referring to? If you're encountering an error, sharing the error log might help me assist you.

a5chin avatar Mar 02 '25 15:03 a5chin

I reran the clone and setup. On WSL it runs fine. On Linux Mint I get the error mentioned.

Details

Step 8/27 : COPY --from=uv --chown=vscode: /uv /uvx /bin/ [2025-03-03T09:46:08.825Z] [2025-03-03T09:46:08.851Z] unable to convert uid/gid chown string to host mapping: can't find gid for group : no such group: [2025-03-03T09:46:08.853Z] Stop (80 ms): Run: docker build -f /tmp/devcontainercli-me/container-features/0.73.0-1740995167140/Dockerfile-with-features -t vsc-python-uv-dd90522bf37d8584391ba3de476b859bd18b7b2a0b0222381f1ccb993c34791c --target dev_containers_target_stage --build-arg UV_VERSION=latest --build-arg DEBIAN_VERSION=bookworm --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/me/programmieren/python/python-uv [2025-03-03T09:46:08.853Z] Error: Command failed: docker build -f /tmp/devcontainercli-me/container-features/0.73.0-1740995167140/Dockerfile-with-features -t vsc-python-uv-dd90522bf37d8584391ba3de476b859bd18b7b2a0b0222381f1ccb993c34791c --target dev_containers_target_stage --build-arg UV_VERSION=latest --build-arg DEBIAN_VERSION=bookworm --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /home/me/programmieren/python/python-uv [2025-03-03T09:46:08.853Z] at RtA (/home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:469:1933) [2025-03-03T09:46:08.854Z] at async jm (/home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:468:1896) [2025-03-03T09:46:08.854Z] at async bH (/home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:468:610) [2025-03-03T09:46:08.854Z] at async TtA (/home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:485:3848) [2025-03-03T09:46:08.854Z] at async iB (/home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:485:4963) [2025-03-03T09:46:08.854Z] at async wrA (/home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:666:203) [2025-03-03T09:46:08.854Z] at async DrA (/home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:665:14830) [2025-03-03T09:46:08.854Z] at async /home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:485:1190 [2025-03-03T09:46:08.861Z] Stop (2096 ms): Run: /usr/share/code/code /home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/me/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-3905b077-ac33-4d4a-a44f-f7ab97ed018e1740995165516 --workspace-folder /home/me/programmieren/python/python-uv --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/home/me/programmieren/python/python-uv --id-label devcontainer.config_file=/home/me/programmieren/python/python-uv/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/me/programmieren/python/python-uv/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration [2025-03-03T09:46:08.861Z] Exit code 1 [2025-03-03T09:46:08.866Z] Command failed: /usr/share/code/code /home/me/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /home/me/.config/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-3905b077-ac33-4d4a-a44f-f7ab97ed018e1740995165516 --workspace-folder /home/me/programmieren/python/python-uv --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/home/me/programmieren/python/python-uv --id-label devcontainer.config_file=/home/me/programmieren/python/python-uv/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/me/programmieren/python/python-uv/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration [2025-03-03T09:46:08.867Z] Exit code 1

Kugeleis avatar Mar 03 '25 09:03 Kugeleis

Thank you for sharing. What is the version of Docker installed on Linux Mint? It seems that version 17.09.0-ce or later is required. https://github.com/docker-archive/docker-ce/releases/tag/v17.09.0-ce

a5chin avatar Mar 03 '25 10:03 a5chin

Docker version 26.1.3, build 26.1.3-0ubuntu1~24.04.1

Kugeleis avatar Mar 03 '25 13:03 Kugeleis

By the way, what is version 9.3.0 referring to? If you referenced the link below, please note that it is completely unrelated to this repository, so the situation is different. Therefore, on Linux, please execute the following separately:

RUN chown ...

Link: flyway issue #3521

a5chin avatar Mar 04 '25 09:03 a5chin

I guess that's what I tried and it worked. Anyway, apparently WSL <> linux even for a container deployment. Maybe you can give a comment in the docs.

Kugeleis avatar Mar 06 '25 12:03 Kugeleis

I would like you to add the command as a comment within this PR.

a5chin avatar Mar 08 '25 06:03 a5chin

This command is necessary, so I'll close it.

a5chin avatar Nov 10 '25 08:11 a5chin