Skip to content

Permissions in docker images are lost during gitpod restore #3174

Closed
@shaal

Description

@shaal

UPDATE:

This problem is actually not just about setuid, but about permissions in general.
Follow this comment #3174 (comment) for an even simpler steps to reproduce the issue.


Describe the bug

In a workspace using sudo docker-up and pulling a docker image, it has sudo with the correct setuid bit.
-rwsrwxrwx 1 root root 157192 Feb 2 2020 /usr/bin/sudo

But after timeout/restarting the workspace, the sudo in the image has the wrong setuid bit
-rwxr-xr-x 1 root root 157192 Feb 2 2020 /usr/bin/sudo

Steps to reproduce

I created a minimal setup to reproduce the behavior:
https://gitpod.io/#https://github.com/shaal/gitpod-restart-test

  1. Start the workspace
  2. The workspace will run sudo docker-up
  3. The workspace will pull an image and display the image's /usr/bin/sudo permissions (ie. docker run -it --rm drud/ddev-webserver:v1.16.3 ls -l /usr/bin/sudo)
  4. The permission should be -rwsrwxrwx
  5. Using https://gitpod.io/workspaces - Stop the current workspace (alternatively you can wait for the workspace to timeout)
  6. Start the same workspace again
  7. Run docker run -it --rm drud/ddev-webserver:v1.16.3 ls -l /usr/bin/sudo
  8. Now the permission is wrong -rwxr-xr-x, it's missing the setuid bit.
  • Please note that the issue happens with any image.

Expected behavior

The setuid bit should stay the same after restarting a workspace.

Additional information

Example repository

https://github.com/shaal/gitpod-restart-test

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions