You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proposal: create a sub-image with sudo and other test dependencies #200
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:
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.
@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 centoshttps://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.
@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 centoshttps://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.
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
Activity
refactor to prepare for adding sub-images (#201)
claudeleveille commentedon Apr 10, 2019
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.
RDIL commentedon Apr 10, 2019
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.
TravisEz13 commentedon Apr 10, 2019
@claude-leveille We are proposing that these would be sub-images. Search for
Related Reposon this page for the example I've published usingcentoshttps://hub.docker.com/_/microsoft-powershellWe 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.
claudeleveille commentedon Apr 10, 2019
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.
[-]Should we include `sudo` in the images[/-][+]Proposal: create a sub-image with `sudo` and other test dependencies[/+]TravisEz13 commentedon Apr 24, 2019
This is implemented. So, I'm closing the issue.