-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-implement scubainit #48
Labels
Comments
I'm struggling to understand what to do with this
Resources: |
JonathonReinhart
added a commit
that referenced
this issue
May 5, 2016
Some of this taken from: https://github.com/JonathonReinhart/suexec See #48
JonathonReinhart
added a commit
that referenced
this issue
May 6, 2016
JonathonReinhart
added a commit
that referenced
this issue
May 11, 2016
Implement new scubainit See #48
Closed via PR #49 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TL;DR
Implement a
scubainit
executable that is the overridingENTRYPOINT
for the container.History
.scubainit
)/etc/passwd
and friends instead of.scubainit
)I think
.scubainit
was a cool idea, and generally accomplished the goal of performing arbitrary setup inside the container, before launching the user command.The real problem however was that
su
fork
s andexec
s the given command, which prevents signals from Docker from being forwarded correctly (see the extended commentary in #22).I went back to c71040b, before #24 was merged, and played with the following alternatives to emitting
su <user command>
in the.scubainit
script. They all "worked", as far as avoiding the Ctrl+C weirdness:write_cmd(*command)
-- Simply run the user command from.scubainit
write_cmd('exec', *command)
--exec
the user command from.scubainit
write_cmd('/suexec', SCUBA_USER, *command)
write_cmd('exec', '/suexec', SCUBA_USER, *command)
suexec
Going Forward
scuba
will provide a statically-linked program calledscubainit
which will be bind-mounted into the container.scubainit
will be passed as the--entrypoint
todocker run
. It will:scubauser
group and userumask
to that of the host.scuba.yml
-defined pre-exec hooks (future feature)setgroups
,setgid
,setuid
to that of the hostexecvp()
itsargv
which is the userCOMMAND
scuba
will set the following environment variables, whichscubainit
will consume and unset before executing the user command:SCUBAINIT_UID
- The UID of the host process, to be set forscubauser
SCUBAINIT_GID
SCUBAINIT_UMASK
SCUBAINIT_HOOK
- Path to a script to execute before executing the user command (future feature)Challenges
Docker images are always Linux, so it should be straightforward to accomplish this on a Linux host. But:
scubainit
need to be compiled during invocation ofsetup.py
?scubauser
thing - we just let the user command run asroot
, and (on OSX anyway), because of how they do the home directory sharing with VirtualBox, the files end up owned by the invoking user.SCUBAINIT_HOOK
withoutscubainit
. Maybe we can include a pre-compiled version in the PyPi package?The text was updated successfully, but these errors were encountered: