Skip to content

install-packages: use gosu / sudo automatically #1108

Open
@abitrolly

Description

Is your feature request related to a problem? Please describe

I'm always frustrated when I have to use sudo in Dockerfile because hadolint complains about it - https://github.com/hadolint/hadolint/wiki/DL3004

Describe the behaviour you'd like

install-packages to use sudo or gosu automatically to install the package.

Additional context

This Dockerfile can not be built.

FROM gitpod/workspace-full:2023-05-08-21-16-55
RUN install-packages yamllint
 => ERROR [2/2] RUN install-packages yamllint                                                                                               0.6s
------
 > [2/2] RUN install-packages yamllint:
#0 0.585 Run this script again as root to install packages.

This Dockerfile is invalid by hadolint.

FROM gitpod/workspace-full:2023-05-08-21-16-55
RUN sudo install-packages yamllint
.gitpod.Dockerfile:2 DL3004 error: Do not use sudo as it leads to unpredictable behavior. Use a tool like gosu to enforce root                  ```

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions