Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Allow unprivileged containers on run_download.sh and run_install.sh #2227

Open
KennethGomez opened this issue Mar 3, 2023 · 2 comments
Open
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not

Comments

@KennethGomez
Copy link

KennethGomez commented Mar 3, 2023

Allow configuration to remove the privileged flag

Description

This feature request comes from the necessity of running Docker on continuous integration and deployment environments. Most of the times, the privileged flag is not allowed to be run on this environments due to security issues within their infrastructure. I don't know the direct implications with removing this flag, I've tried to run the .sh files generated without that flag and turns out no exception gets thrown.

These flags are on these .sh templates:

# Run the builder image.
cid=$("$DOCKER" $DOCKER_FLAGS run -w="/" -d --privileged $image_id sh -c $'%{download_commands}')
"$DOCKER" $DOCKER_FLAGS attach $cid
"$DOCKER" $DOCKER_FLAGS cp $cid:%{installables}_packages.tar %{output}

cid=$("$DOCKER" $DOCKER_FLAGS run -d -v $vid:/tmp/pkginstall --privileged $image_id /tmp/pkginstall/installer.sh)
"$DOCKER" $DOCKER_FLAGS attach $cid || true

Describe the solution you'd like

I'd like to have some configuration for these rules to disable the privileged mode for docker run command

@KennethGomez
Copy link
Author

I can write a PR for this if wanted and needed!

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not
Projects
None yet
Development

No branches or pull requests

1 participant