{"id":13526614,"url":"https://github.com/weiwenhao/parker","last_synced_at":"2025-10-13T20:44:44.310Z","repository":{"id":196041015,"uuid":"691851522","full_name":"weiwenhao/parker","owner":"weiwenhao","description":"🍀 package the workdir into a lightweight container runtime that can be executed directly.","archived":false,"fork":false,"pushed_at":"2025-05-10T11:39:12.000Z","size":67,"stargazers_count":95,"open_issues_count":0,"forks_count":8,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-10-12T10:58:13.140Z","etag":null,"topics":["build-tool","container","nature-lang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weiwenhao.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":"2023-09-15T03:01:18.000Z","updated_at":"2025-09-16T13:34:38.000Z","dependencies_parsed_at":"2023-09-21T04:40:51.442Z","dependency_job_id":"cef495f9-b048-40d2-aeda-e6b3e3d2a8e8","html_url":"https://github.com/weiwenhao/parker","commit_stats":null,"previous_names":["weiwenhao/parker"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/weiwenhao/parker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weiwenhao%2Fparker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weiwenhao%2Fparker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weiwenhao%2Fparker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weiwenhao%2Fparker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weiwenhao","download_url":"https://codeload.github.com/weiwenhao/parker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weiwenhao%2Fparker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016929,"owners_count":26085911,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"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":["build-tool","container","nature-lang"],"created_at":"2024-08-01T06:01:32.231Z","updated_at":"2025-10-13T20:44:44.271Z","avatar_url":"https://github.com/weiwenhao.png","language":"Go","funding_links":[],"categories":["Go","命令行工具"],"sub_categories":[],"readme":"# Parker\n\nLightweight packaging tool and container runtime, a single command packages the working directory into an executable file.\n\n![](https://raw.githubusercontent.com/weiwenhao/pictures/main/blogs20230922113619.png)\n\n\nThe example demonstrates a C language-based IP resolution service (`gcc -o ipservice`), dependent on the ipdb resource file.\n\nUse Parker to compress the executable file `ipservice` and its dependent asset into a new executable file named `ipservice-c`.\n\nWhen `ipservice-c` is run on the target machine, it will create a lightweight container environment to operate the original `ipservice` service.\n\n## ⚙️ Installation\n\nDownload and unpack the Parker installation package from [github releases](https://github.com/weiwenhao/parker/releases). It's recommended to move the unzipped parker folder to `/usr/local/` and add the `/usr/local/parker/bin` directory to your system's environment variables.\n\n```\n\u003e parker --version\n1.0.1\n```\n\n## 📦 Usage\n\n`cd` to your working directory and run `parker :target`. This command packages the `:target` along with the current working directory into an executable file named `:target-c`. Once packaged, move this executable file to your target machine and run it.\n\n```\n\u003e cd :workdir \u0026\u0026 parker :target\n```\n\n#### Example\n\nThe above example of packaging the executable file and resource file is a **standard usage** example. However, there are non-standard usage scenarios as well, such as with a server written in python3.11:\n\n```\n\u003e tree .\n├── bar.png\n├── foo.txt\n├── python # cp /usr/bin/python3.11 ./\n└── server.py\n```\n\nContent of server.py:\n\n```python\nfrom http.server import SimpleHTTPRequestHandler, HTTPServer\n\ndef run():\n    print(\"listen on http://127.0.0.1:8000\")\n    server_address = ('127.0.0.1', 8000)\n    httpd = HTTPServer(server_address, SimpleHTTPRequestHandler)\n    httpd.serve_forever()\n\nrun()\n```\n\nWhen you `cd` to the working directory and run `parker python`, you'll receive a `python-c` file. This is the packaged executable file. Upload it to the target machine and run it.\n\n```\n\u003e parker python\npython-c\n├── server.py\n├── python\n├── foo.txt\n└── bar.png\n🍻 parker successful\n\n------------------------------------------------------------------------ move pyhon-c to target\n\u003e tree .\n.\n└── python-c\n\n0 directories, 1 file\n\n------------------------------------------------------------------------ run python-c\n\u003e ./python-c server.py\nlisten on http://127.0.0.1:8000\n```\n\nHere, `python-c` passes arguments to the python process.\n\n\u003e ❗️ Parker does not solve python's dynamic compilation issues.\n\n## 🚢 Runtime\n\n`python-c` is a lightweight container runtime created by Parker. It's a statically compiled executable file. When executed, it uses the linux namespace to create an isolated environment and then unpacks the working directory to run the target python.\n\n`python-c` monitors the python main process during its execution. If the python process stops or encounters an error, `python-c` will utilize cgroup to clean up the container environment and kill all of python's child processes.\n\nAll arguments and signals passed to `python-c` will be relayed directly to the python process.\n\n## 🐧 Dependencies\n\nThe container runtime depends on cgroup and namespace, requiring a linux kernel version higher than 2.6.24. Also, cgroup should be correctly mounted. Check for the existence of either `/sys/fs/cgroup/cgroup.controllers` or `/sys/fs/cgroup/freezer` directories.\n\nTested environments: ubuntu:22 / ubuntu:20\n\n## 🛠️ Make build\n\nThe source code is developed in the [nature](https://github.com/nature-lang/nature) programming language. The nature compiler version needs to be \u003e= 0.4.0. After installation, execute `make amd64 \u0026\u0026 make install` in the source code directory to install to the /usr/local/parker directory.\n\n\u003e Nature currently primarily supports amd64 builds. Executables built by nature have a smaller size and higher efficiency. For other architectures, the main repository provides a golang version.\n\n## 🎉 Thanks\n\n[nature](https://github.com/nature-lang/nature) is a modern system-level programming language and compiler. It works hand in hand with C for high-performance and efficient development.\n\nThe community-available version of nature is about to be released. Early experiences and feedback are welcome. You're also invited to contribute to the standard library; all contributions will be merged into the main repository.\n\n## 🪶 License\n\nThis project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n\nCopyright (c) 2020-2023 WEIWENHAO, all rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweiwenhao%2Fparker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweiwenhao%2Fparker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweiwenhao%2Fparker/lists"}