{"id":18614044,"url":"https://github.com/enthought/sailor","last_synced_at":"2026-01-25T02:02:21.658Z","repository":{"id":66039677,"uuid":"49785654","full_name":"enthought/sailor","owner":"enthought","description":"Default Repo description from terraform module","archived":false,"fork":false,"pushed_at":"2016-01-16T17:13:42.000Z","size":260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-17T01:10:01.735Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ApacheConf","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enthought.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-16T18:33:11.000Z","updated_at":"2021-06-01T19:58:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe68fa18-04d0-49f8-b07b-66060e92ff9b","html_url":"https://github.com/enthought/sailor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/enthought/sailor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fsailor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fsailor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fsailor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fsailor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enthought","download_url":"https://codeload.github.com/enthought/sailor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enthought%2Fsailor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28741634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T01:40:51.112Z","status":"online","status_checked_at":"2026-01-25T02:00:06.841Z","response_time":113,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T03:24:52.649Z","updated_at":"2026-01-25T02:02:21.641Z","avatar_url":"https://github.com/enthought.png","language":"ApacheConf","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sailor\n\n## Wannabe portable container system\n\n**WARNING** this project is still under heavy development, use it at your own\nrisk and `pull` frequently!\n\n`sailor` is based on [chroot][0] and [pkgin][1], it will create a `chrooted`\nenvironment containing _only_ the needed pieces in order to install and  / or\nrun a service.\n\n**For now** _NetBSD_ and _Darwin / Mac OS X_ are the primary targets of this\nproject.\n\nNote that `sailor`'s goal is **not** to provide bullet-proof security, `chroot`\nis definitely not a trustable isolator; instead, `sailor` is a really\nconvenient way of trying / testing an evironment without compromising your\nworkstation filesystem.\n\n## demo\n\n![gif](http://imil.net/stuff/sailor.gif)\n\n## requirements\n\n`sailor` needs the following third party tools:\n\n* `pkg_install`\n* `pkgin`\n* `rsync`\n\n_NetBSD_ users should have those by default, except for `rsync` which can be\ninstalled with `pkgin`.\n\n_Mac OS X_ users are encouraged to use [Save OS X][2] in order to have a working\nenvironment within seconds.\n\n## usage\n\n* Create a ship\n\n```\n# ./sailor.sh build ./nginx.conf\n```\n\n* Run the ship\n\n```\n# ./sailor.sh start ./nginx.conf\nStarting nginx.\n```\n\n* List running ships\n\n```\n# ./sailor.sh ls\nID                 | name            | configuration file        | uptime    \n--------------------------------------------------------------------------------\n4ecd1896d35a66c7   | nginx           | examples/nginx.conf       | 00:01:05  \n```\n\n* Stop a ship\n\n```\n# ./sailor.sh stop 4ecd1896d35a66c7\n```\n\n* Destroy a ship\n\n```\n# ./sailor.sh destroy ./nginx.conf\n```\n\n* Display the `rc.d` name for a service\n\n```\n# ./sailor.sh rcd apache\nlikely name for service: apache\n```\n\n* Run commands in the ship\n\n```\n# ./sailor.sh run 4ecd1896d35a66c7 ps axuwww\n```\n\n## configuration file\n\nA ship is defined by its configuration file which contains:\n\n_mandatory_\n\n* `shipname`: the convenient name you'd like to give to your ship\n* `shippath`: full path to your ship\n\n_most likely_\n\n* `services`: the `rc.d` friendly names for services to run(*)\n* `packages`: the packages you'd like to install within your ship\n\n(*) the `rc.d` or _init_ script is generally bundled with the service package,\nit is it which is capable of starting or stopping the service. Most of the\ntimes, it has the same name as the service itself, but it is safer to check this\nout using `sailor`'s `rc.d` function.\n\n_optional_\n\n* `shipbins`: binaries from the host system you'd like to copy to the ship\n* `ro_mounts`: read-only mount points to the ship (NetBSD only for now)\n* `rw_mounts`: read/write mount points to the ship (NetBSD only for now)\n* `ip_\u003ciface\u003e`: IP alias to add to `\u003ciface\u003e`\n\n`run_at_*` commands are run in the chroot:\n\n* `run_at_build`: run command at build time, can be repeated\n* `run_at_start`: run command at start time, can be repeated\n* `run_at_stop`: run command at stop time, can be repeated\n* `run_at_destroy`: run command at destroy time, can be repeated\n\n## real life examples\n\nIn these examples, we will use the `sudo -E` command to run `sailor` with `root`\nprivileges but still keeping environment variables so the `${HOME}` variable\nin the `ship` configuration file is evaluated as our user's home directory.\n\n#### Fire up a fully working and isolated [nginx][3] + [php-fpm][4] stack\n\n[Download and install Save OS X][5] if running Mac OS X\n\n```\n$ git clone https://github.com/NetBSDfr/sailor.git\n$ cd sailor\n$ sudo -E ./sailor.sh build examples/nginxphp.conf\n$ sudo -E ./sailor.sh start examples/nginxphp.conf\nStarting nginx.\nStarting php_fpm.\n\nnginx is listening on port 1080\n\n$ curl -I localhost:1080\nHTTP/1.1 200 OK\nServer: nginx/1.9.4\nDate: Mon, 11 Jan 2016 15:40:53 GMT\nContent-Type: text/html; charset=UTF-8\nConnection: keep-alive\nX-Powered-By: PHP/5.6.13\n```\n\nPHP source code can be found in `nginxphp/var/www/php` which you can `chown` to\nyour own user and populate with the PHP code you want.\n\n`nginx` configuration is located in `nginxphp/opt/pkg/etc/nginx` (on OSX), you\nmight want to change its listen port in\n`nginxphp/opt/pkg/etc/nginx/global.conf`\n\n#### Fire up a fully working and isolated [nginx][3] + [nodejs][6] stack\n\n[Download and install Save OS X][5] if running Mac OS X\n\n```\n$ git clone https://github.com/NetBSDfr/sailor.git\n$ cd sailor\n$ sudo -E ./sailor.sh build examples/nginxnode.conf\n$ sudo -E ./sailor.sh start examples/nginxnode.conf \nStarting nginx.\n[PM2] Spawning PM2 daemon\n[PM2] PM2 Successfully daemonized\n[PM2] Starting hello.js in fork_mode (1 instance)\n[PM2] Done.\n┌──────────┬────┬──────┬───────┬────────┬─────────┬────────┬────────┬──────────┐\n│ App name │ id │ mode │ pid   │ status │ restart │ uptime │ memory │ watching │\n├──────────┼────┼──────┼───────┼────────┼─────────┼────────┼────────┼──────────┤\n│ hello    │ 0  │ fork │ 12874 │ online │ 0       │ 0s     │ 0 B    │ disabled │\n└──────────┴────┴──────┴───────┴────────┴─────────┴────────┴────────┴──────────┘\n Use `pm2 show \u003cid|name\u003e` to get more details about an app\n\nnginx is listening on port 1080\n\n$ curl http://localhost:1080/\nHello from inside the chroot!\n```\n\nIn this example, an [nginx][3] server is configured to act as a reverse proxy\nto a `nodejs` small web app. The application is started by the [pm2][7] process\nmanager and listens on port 8080. This setup is based on [this great\ndocumentation][8] and automatize all the steps described.\n\n`node` source code can be found in `nginxphp/var/node` which you can `chown` to\nyour own user and populate with the `node` code you want.\n\n#### Others examples\n\nA couple of other examples are available in the `examples` directory:\n\n* `namp.conf`\n\n  A basic `apache` / `MySQL` / `PHP` stack\n\n* `nginx.conf`\n\n  A simple `nginx` server\n\n* `nginxflaskapi.conf`\n\n  A full `nginx` / `python` / `Flask` / `gunicorn` stack running [Flask-API][9]\n  to provide an easily programmable `REST` interface.\n\nProbably more to come...\n\n[0]: https://en.wikipedia.org/wiki/Chroot\n[1]: http://pkgin.net\n[2]: http://saveosx.org/\n[3]: http://nginx.org/\n[4]: http://php.net/manual/en/install.fpm.php\n[5]: http://saveosx.org/download-and-install/\n[6]: https://nodejs.org/en/\n[7]: http://pm2.keymetrics.io/\n[8]: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-14-04\n[9]: http://www.flaskapi.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenthought%2Fsailor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenthought%2Fsailor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenthought%2Fsailor/lists"}