Skip to content
Unfurl Cloud
  • Dashboard
  • Blueprints
  • Cloud
Projects Groups Topics Snippets
  • Help
  • Register
  • Sign in
  • unfurl unfurl
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Milestones
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
Closed
Open
Issue created Mar 06, 2021 by Adam@adamOwner

support docker as a "runtime"

Instead of running unfurl in a python virtual machine we should have an option to have it run inside of docker. The runtime specifier could be "docker:image" (instead "venv:"), "docker:" alone would use a default container image we supply.

Here's some pseudocode for invoking a container with docker so that it has access to the local file system and the local docker daemon:

root_dir = project_root
reldir = os.path.relpath('.', root_dir)
exec docker run -it --rm \
    -u $(id -u):$(id -g) \
    -e HOME="/home/$USER" -e USER=$USER -v "$HOME":"/home/$USER" \
   -v "$root_dir":/data \
    -w /data/$reldir \ # workdir is cwd in container
    -v /var/run/docker.sock:/var/run/docker.sock
    $CONTAINER_NAME $unfurl_cmd

Of course the container would have to be trusted when used in this manner. The entry point for adding this support is [_remoteCmd in __main__](https://github.com/onecommons/unfurl/blob/master/unfurl/__main__.py#L217

Assignee
Assign to
Time tracking