Skip to content

Proposal: create a sub-image with sudo and other test dependencies #200

Closed

Description

Create a sub-image with sudo and other test dependencies

Motivation

We use our images for CI and the CI system expects sudo to already exist so it does not have to understand all the package management systems.

Proposal

We can have images which have sudo and an image which does not.

These images would be published as mcr.microsoft.com/powershell/test-deps,
allowing us to add any other dependencies that we find are needed for running tests.

Note, this would not have the agent. This is meant for container job in Azure DevOps or CircleCI.

Alternative proposal

Just include it everywhere

sudo is small, so, I propose we just add it to all images.

The images will still default to root. So, it will not be needed by default.

Alternative names

Alternatives to test-deps in mcr.microsoft.com/powershell/test-deps:

  • ci-cd
  • test-tools

cc Ryen Tang (@kiazhi) Reece Dunham (@RDIL)

Activity

  1. claudeleveille commented on Apr 10, 2019

    @claudeleveille
    Contributor

    I personally maintain a collection of images that I intend for use in CI systems and have added sudo to those. I don't think it makes sense to add it here though. The only case where sudo is handy is when you're running in a CI system like Azure Pipelines, which doesn't run as root in the container. But, every other CI system I've used just runs as root. I can see how this would be convenient, but I think it's a little dangerous at this level. I don't agree with tossing in privilege escalation tooling in images that people might use in production (remember, unprivileged users get root for free with sudo in a container).

    I don't know if it's the same for you, but I've got this gut feeling that this is not considered an anti-pattern for just one reason. I don't really want to find out in just how many ways, either.

  2. RDIL commented on Apr 10, 2019

    @RDIL
    Collaborator

    I’d have to think about this. One side of me says this is the right way to go, the other side says not to.

  3. TravisEz13 commented on Apr 10, 2019

    @TravisEz13
    MemberAuthor

    @claude-leveille We are proposing that these would be sub-images. Search for Related Repos on this page for the example I've published using centos https://hub.docker.com/_/microsoft-powershell

    We need the images, and we don't want a second infrastructure to build them. Technically we don't have to publish them, but it seems a waste to build them and not make them available.

  4. claudeleveille commented on Apr 10, 2019

    @claudeleveille
    Contributor

    @claude-leveille We are proposing that these would be sub-images. Search for Related Repos on this page for the example I've published using centos https://hub.docker.com/_/microsoft-powershell

    We need the images, and we don't want a second infrastructure to build them. Technically we don't have to publish them, but it seems a waste to build them and not make them available.

    I agree to make them just another tag in here, but I really would rather not have sudo in the more vanilla image set. I need to be able to use the vanilla images in production scenarios where I drop privileges and I don't want sudo to be there. Maybe I'd even use the vanilla images as the base for an image that contains a Spring backend (because I like having pwsh in there for when I need to take a look inside the container/write entrypoint scripts, etc.), and I don't need or want sudo in there.

    If you guys can save on maintenance overhead by shoving those test-dep images in here, then I don't see why you wouldn't. Thanks for putting these together, BTW. Real nice work.

  5. changed the title [-]Should we include `sudo` in the images[/-] [+]Proposal: create a sub-image with `sudo` and other test dependencies[/+] on Apr 11, 2019
  6. TravisEz13 commented on Apr 24, 2019

    @TravisEz13
    MemberAuthor

    This is implemented. So, I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions