radial / imagebase-spoke

Base Dockerfile for Spoke containers. Supervisor and SSH built-in for your apps.
https://index.docker.io/u/radial/spoke-base
2 stars 1 forks source link

Split setup logic from run logic in spokes #8

Open brianclements opened 9 years ago

brianclements commented 9 years ago

Right now, everything regarding setup/prep is run in same entrypoint script as the final binary. It would be nice if either the spoke-entrypoint.sh or the supervisor subprocess files could run setup logic (which usually needs root) separate from the final binary (which could be any user). Right now every individual spoke subprocess .ini file runs entrypoint as root, and privileges need to be dropped within the script to actually run as a different user. This seems a bit too generalized and hackish. I would like either:

  1. figure out how to have supervisor run setup logic THEN start the binary using separate subprocesses, each with appropriate users (supervisor hates proper serialization though!)
  2. move install scripts to a drop-in /setup.d directory for root to just run in spoke-entrypoint.sh so that binary can be free to be properly run in supervisor subprocess
    1. this would bring install logs outside of supervisor. This could solve the format inconsistencies however in #7 between the nicely formated supervisor output and the setup output which is hacked to go into supervisor. maybe setup messages should go to it's own logfile once and for all and save stdoutt/stderr for pure application output which would be always formatted properly.