Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zeabur/zbpack
Build your project into static assets, serverless function or container image with magic, no Dockerfile needed!
https://github.com/zeabur/zbpack
build-tool buildpack docker go golang zeabur
Last synced: 3 days ago
JSON representation
Build your project into static assets, serverless function or container image with magic, no Dockerfile needed!
- Host: GitHub
- URL: https://github.com/zeabur/zbpack
- Owner: zeabur
- License: mpl-2.0
- Created: 2022-12-26T10:59:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-08T04:44:06.000Z (7 months ago)
- Last Synced: 2024-04-14T10:36:12.314Z (7 months ago)
- Topics: build-tool, buildpack, docker, go, golang, zeabur
- Language: Go
- Homepage:
- Size: 2.05 MB
- Stars: 233
- Watchers: 7
- Forks: 38
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# zbpack
`zbpack` (pronounced “Zeabur Pack”) aims to automatically analyze the language, version, and framework used based on the source code and package the service into the most suitable deployment form, such as static resources, cloud functions, containers, or multiple types by one click. It is mainly used in the [Zeabur](https://zeabur.com) platform as the build tool to determine the code type and build the container image automatically (without writing the Dockerfile manually.)
## Components
`zbpack` is consist of the following components:
- Planners: The planners are responsible for analyzing the source code and determining the type of the code. The planners are located in the `internal` directory.
- `zeaburpack` library: The `zeaburpack` library is the library of `zbpack` that can be used in your platform directly. It is located in the `pkg/zeaburpack` directory.
- CLI: The CLI is the command-line interface of `zbpack` for testing purpose. It is located in the `cmd/zbpack` directory.## Usage
### Common Part
1. Fork the repository and clone it to your local machine.
2. Make sure you have Go installed on your machine. You can download it from the official website:
3. Navigate to the root of the project and run `go mod download` to download the necessary dependencies.
4. Make sure [buildctl](https://github.com/moby/buildkit) is installed and buildkitd is running.### `zbpack`
`zbpack` analyzes your projects, constructs the image recipes, and builds the container image automatically.
1. Build the binary by running `go build -o zbpack ./cmd/zbpack/main.go`.
2. Run the binary with `./zbpack [the directory to analyze and build]`.You should see the `build plan` block and the subsequent `build log` block. The `build plan` block shows the metadata and the information (“recipes”) to build an image of this project. The `build log` block shows the build log of the container image, which is outputted by `docker build`.
Use `-i` or `--info` to show the build plan only.
```bash
$ ./zbpack --info corepack-project╔══════════════════════════ Build Plan ═════════════════════════╗
║ provider │ nodejs ║
║───────────────────────────────────────────────────────────────║
║ startCmd │ node index.js ║
║───────────────────────────────────────────────────────────────║
║ packageManager │ pnpm ║
║───────────────────────────────────────────────────────────────║
║ framework │ none ║
║───────────────────────────────────────────────────────────────║
║ nodeVersion │ 16 ║
║───────────────────────────────────────────────────────────────║
║ installCmd │ pnpm install ║
╚═══════════════════════════════════════════════════════════════╝
```Get some more usage information by using `-h` or `--help`.
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.
## License
`zbpack` is licensed under the [Mozilla Public License 2.0](./LICENSE). According to MPL 2.0 (and the summarization of Bing AI), if you want to use, modify or distribute MPL 2.0 software, you have the following rights and obligations:
- You have the right to use, modify and distribute MPL 2.0 software for any purpose, without paying any fees.
- You have the obligation to preserve the license notice, copyright notice and disclaimer in MPL 2.0 source code files.
- You have the obligation to disclose any modifications you make to MPL 2.0 source code files, and to provide them to others under MPL 2.0 or a more permissive license.
- You have the right to combine MPL 2.0 source code files with source code files under other licenses in a software, but you cannot change the license of MPL 2.0 source code files.
- You have the right to choose to provide MPL 2.0 source code files to others under another compatible Copyleft license, such as GNU GPL, LGPL or AGPL.## Contributors