{"id":15675806,"url":"https://github.com/manics/repo2shellscript","last_synced_at":"2025-04-30T15:45:41.513Z","repository":{"id":40422732,"uuid":"284353660","full_name":"manics/repo2shellscript","owner":"manics","description":"A plugin for repo2docker that outputs a directory with a shell-script and required files","archived":false,"fork":false,"pushed_at":"2024-12-02T18:02:47.000Z","size":173,"stargazers_count":13,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-14T02:51:08.469Z","etag":null,"topics":["jupyter","packer","repo2docker","repo2packer","repo2vm"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manics.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-01T23:09:06.000Z","updated_at":"2022-02-14T22:06:08.000Z","dependencies_parsed_at":"2024-10-23T12:11:52.727Z","dependency_job_id":null,"html_url":"https://github.com/manics/repo2shellscript","commit_stats":{"total_commits":82,"total_committers":2,"mean_commits":41.0,"dds":0.426829268292683,"last_synced_commit":"4d67dc814913e4351a02d521441103ea78e68d32"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manics%2Frepo2shellscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manics%2Frepo2shellscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manics%2Frepo2shellscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manics%2Frepo2shellscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manics","download_url":"https://codeload.github.com/manics/repo2shellscript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246355199,"owners_count":20763962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["jupyter","packer","repo2docker","repo2packer","repo2vm"],"created_at":"2024-10-03T16:00:50.795Z","updated_at":"2025-03-31T15:31:00.608Z","avatar_url":"https://github.com/manics.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# repo2shellscript (and Packer)\n\n[![Build](https://github.com/manics/repo2shellscript/workflows/Build/badge.svg)](https://github.com/manics/repo2shellscript/actions)\n\n`repo2shellscript` is a plugin for [repo2docker](http://repo2docker.readthedocs.io) that outputs a directory with a shell-script and required files.\nIt does not build a container image, instead you should take the output and use it to build some other execution environment, either by running the output scripts or using one of the included Packer templates.\n\n\n## Installation\n\nThis plugin is still in development.\n\n    pip install -U git+https://github.com/manics/repo2shellscript.git@main\n\n\n## Running\n\nSimply include `--engine shellscript` in the arguments to `repo2docker`:\n\n    repo2docker --engine shellscript --no-run repository/to/build\n\nSince this does not build anything you must pass `--no-run`.\n\nExample:\n\n    $ repo2docker --engine shellscript --user-name test --user-id 1002 --no-run https://github.com/binder-examples/conda\n\n    Picked Git content provider.\n\n    Using CondaBuildPack builder\n    Output directory: /home/test/repo2shellscript-output/r2dhttps-3a-2f-2fgithub-2ecom-2fbinder-2dexamples-2fconda5778653\n    Build script: /home/test/repo2shellscript-output/r2dhttps-3a-2f-2fgithub-2ecom-2fbinder-2dexamples-2fconda5778653/repo2shellscript-build.bash\n    Start script: /home/test/repo2shellscript-output/r2dhttps-3a-2f-2fgithub-2ecom-2fbinder-2dexamples-2fconda5778653/repo2shellscript-start.bash\n    Systemd service: /home/test/repo2shellscript-output/r2dhttps-3a-2f-2fgithub-2ecom-2fbinder-2dexamples-2fconda5778653/repo2shellscript.service\n    Packer templates: /home/test/repo2shellscript-output/r2dhttps-3a-2f-2fgithub-2ecom-2fbinder-2dexamples-2fconda5778653/repo2docker.pkr.hcl /home/test/repo2shellscript-output/r2dhttps-3a-2f-2fgithub-2ecom-2fbinder-2dexamples-2fconda5778653/repo2vagrant.pkr.hcl\n    User: test\n    Jupyter token: 4973fff2-3a21-4f24-a179-379e96a363d6\n\n- Output directory: should contain everything required to build the environment, e.g. you could copy this to a Ubuntu 18.04 virtual machine\n- Build script: a bash script that will build the environment, must be run as `root`\n- Start script: a bash script that should be used to start the environment\n- Systemd service: an alternative to the start script\n- Packer templates: Packer templates for Vagrant VirtualBox and Docker\n- User: The user that should be used to run the start script\n- Jupyter token: A generated token baked into the scripts\n\n\n### Example of using the output\n\nThis uses a plain `ubuntu:18.04` Docker container as the base environment 🙂:\n\n    docker run -it --name repo2shellscript -p 8888:8888 \\\n        -v /home/test/repo2shellscript-output/r2dhttps-3a-2f-2fgithub-2ecom-2fbinder-2dexamples-2fconda5778653:/src:ro \\\n        ubuntu:18.04\n    cd /src\n    ./repo2shellscript-build.bash\n    sudo -u \u003cUSER\u003e ./repo2shellscript-start.bash\n\n\n### Systemd service:\n\nIf you use a Ubuntu:18.04 virtual machine your can use Systemd to start jupyter notebook:\n\n    cp repo2shellscript.service /etc/systemd/system/\n    systemctl daemon-reload\n    systemctl start repo2shellscript\n\nConnect to http://IP:8888.\nYou will need to enter the auto-generated `Jupyter token` from above.\nIf you have lost the output you can find the token in `repo2shellscript-start.bash` or `repo2shellscript.service`.\nAlternatively set a fixed token in the configuration file.\n\n\n### Building a vagrant image with Packer\n\nPacker templates for building Virtualbox Vagrant (`repo2vagrant.pkr.hcl`) and Docker (`repo2docker.pkr.hcl`) images are included:\n\n    cd repo2shellscript-output/r2dhttps-3a-2f-2fgithub-2ecom-2fbinder-2dexamples-2fconda5778653/\n    packer build repo2vagrant.pkr.hcl\n    packer build repo2docker.pkr.hcl\n\nNote you must ensure the repo2docker `--user-name` and `--user-id` (also used as a group id) do not exist in the base image.\nThe [`ubuntu/bionic64`](https://app.vagrantup.com/ubuntu/boxes/bionic64) Vagrant box already contains group IDs `1000` and `1001` so you should set `--user-id` to `1002` or greater.\n\n\n### Configuration file\n\nFor convenience you may wish to set a fixed token instead of the one randomly generated when the scripts are written.\nCreate a repo2docker configuration file, such as `repo2docker_config.py` with\n\n```py\nc.ShellScriptEngine.jupyter_token = 'secret123'\n```\n\nand run\n\n    repo2docker --config repo2docker_config.py ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanics%2Frepo2shellscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanics%2Frepo2shellscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanics%2Frepo2shellscript/lists"}