{"id":23540958,"url":"https://github.com/w13b3/redbean-container","last_synced_at":"2026-01-22T08:33:51.110Z","repository":{"id":238131899,"uuid":"782662546","full_name":"w13b3/redbean-container","owner":"w13b3","description":"redbean in a container","archived":false,"fork":false,"pushed_at":"2025-01-14T19:41:52.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T04:34:38.196Z","etag":null,"topics":["container","cosmopolitan","redbean"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/w13b3.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":"2024-04-05T18:53:10.000Z","updated_at":"2025-01-14T19:41:55.000Z","dependencies_parsed_at":"2024-12-08T10:22:02.739Z","dependency_job_id":"f42e2958-3b4b-451e-8b96-035ac9ef5811","html_url":"https://github.com/w13b3/redbean-container","commit_stats":null,"previous_names":["w13b3/redbean-container"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/w13b3/redbean-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2Fredbean-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2Fredbean-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2Fredbean-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2Fredbean-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w13b3","download_url":"https://codeload.github.com/w13b3/redbean-container/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2Fredbean-container/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28659518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["container","cosmopolitan","redbean"],"created_at":"2024-12-26T05:13:17.654Z","updated_at":"2026-01-22T08:33:51.090Z","avatar_url":"https://github.com/w13b3.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redbean-container  \u003csub\u003e\u003csup\u003e_redbean in a container_\u003csup\u003e\u003csub\u003e\n\nThis project uses Docker [Bake].  \n\n\n## How to build\n\u003e Prerequisites:  \n\u003e - Recent version of [Docker] installed  \n\u003e - Docker [BuildKit] installed (this can be a plugin on your system)  \n\nDocker Bake can use a [remote] Bake file definition to locally build an image.  \nBuild an image with the following command:  \n```shell\ndocker buildx bake https://github.com/w13b3/redbean-container.git\n```\n\n\n### The result\nOnce the build is completed, the tag `redbean:optlinux` is given to the image.  \nThe [scratch] based image contains the redbean binary, build with the `optlinux` mode, using the latest commit to [Cosmopolitan] default branch.  \n\n\n### How to use\nStart the image with the following command:  \n```shell\ndocker run -it -p 9090:8080 redbean:optlinux\n```\nThe redbean process in the container is now serving the default website.  \nUsing a browser the website can be visited at http://127.0.0.1:9090/  \n\n\n## Customize the build\nYou can [override variable] defaults set in the Bake file using environment variables.  \n\n\n### Different modes\nCosmopolitan provides a variety of build modes which result in different binaries.  \nThis project uses `optlinux` as the default mode to build the redbean binary.  \nThere are other modes, including but not limited to: `tinylinux`, `asan` or `rel`.  \n\nThe following example sets the `MODE` variable to `opt`, overriding the default `MODE` variable.  \n```shell\nMODE=opt docker buildx bake https://github.com/w13b3/redbean-container.git\n```\nUsing `MODE=opt` an image with the tag `redbean:opt` is created after a successful build.  \n\n\n### Previous versions\nIt is possible to build an image that includes a previous version of redbean.  \nTo do this, a full SHA of the Cosmopolitan commit is needed.  \n\nThe following command overrides the `COMMIT` variable with a full SHA to build an image containing redbean [v2.0.1].  \n```shell\nCOMMIT=\"42b34c26f8099658386fc867c49b0b8e59993415\" docker buildx bake https://github.com/w13b3/redbean-container.git\n```\nWhen the build is successful an image with the tag `redbean:optlinux-42b34c` is available.  \n\n\n### Output the binary\nWhile using containerized software is convenient, there are instances where a standalone binary is preferred.  \nRetrieving the built binary is possible by setting `binary-output` as the [bake target].  \n\nThe command below overrides the default target with `binary-output`\n```shell\ndocker buildx bake https://github.com/w13b3/redbean-container.git binary-output\n```  \nAfter the build is completed successfully an `ouput` directory is created which contains the standalone binary.\n\n\n## Build other binaries\nThe [Cosmopolitan] repository offers other tools that can be built.  \nUsing this project, another binary can be built by setting the `TARGET_PATH` variable.\n\n```shell\nTARGET_PATH=/tool/hello/hello docker buildx bake https://github.com/w13b3/redbean-container.git\n```\nWith a successful build the image with the tag `hello:optlinux` is created.  \nThe filename of the path given to `TARGET_PATH` becomes the name of the image.  \n\nBuild other tools by setting the `TARGET_PATH` paths with:  \n- [/tool/viz/life](https://github.com/jart/cosmopolitan/blob/master/tool/viz/life.c)  \n- [/tool/build/pledge](https://github.com/jart/cosmopolitan/blob/master/tool/build/pledge.c)\n- [/third_party/python/python3](https://github.com/jart/cosmopolitan/blob/master/third_party/python/python3.c)  \n \n\n## Build images without Docker Bake \nIt can happen Docker Bake is not installed on your system.  \nStill, this project lets you build an image with just [Docker Build].  \n\nThis command lets you build an image containing `redbean` created using `tinylinux` mode.  \n```shell\ndocker build --file dockerfiles/Dockerfile.scratch --build-arg MODE=tinylinux --tag redbean:tinylinux https://github.com/w13b3/redbean-container.git\n```\n\u003e Using [`podman`][podman] or [`buildah`][buildah]?  \n\u003e With this method you can replace [`docker`][docker] with either of those programs to build an image.\n\n\n## Motivation\n\u003e tl;dr: To learn how to containerize software  \n\n[Cosmopolitan] is an awesome project and [redbean] is a very capable web server.  \nWhile writing this, the latest version of redbean (v2.2) was released on [02-Nov-2022].  \nIn the meantime [really] [cool] [features] were added to the source of redbean.  \nBut to use these features, redbean must be built from source.  \n\nInstead of using [containerized][kissgyorgy] software I wanted to learn how to containerize software.  \nI wanted to know the best practices regarding containerization and apply them.  \nI wanted to distribute images.  \nAnd I also wanted to use the newest available features in redbean.  \nSo I decided to combine the learning goals into this project.  \n\n\u003e On [17-Aug-2024] redbean v3.0.0 has been released\n\n\n## Acknowledgements\n[jart], The creator of the [Cosmopolitan] project which includes the [redbean] source code.  \n[redbean-docker][kissgyorgy], The repository that containerize pre-build redbean binaries.  \n\n\n## License\nSee [LICENSE](./LICENSE)  \n\n\n### Licenses of included or used software\nSee https://redbean.dev/#legal  \nSee [Cosmopolitan/LICENSE](https://github.com/jart/cosmopolitan/blob/master/LICENSE)  \n\nPlease adhere to the licenses of the other included or used software.  \n\n\n[Bake]: https://docs.docker.com/build/bake/\n[scratch]: https://hub.docker.com/_/scratch\n[Docker]: https://docs.docker.com/get-docker/\n[BuildKit]: https://docs.docker.com/build/buildkit/\n[remote]: https://docs.docker.com/build/bake/remote-definition/\n[override variable]: https://docs.docker.com/build/bake/reference/#variable\n[v2.0.1]: https://github.com/jart/cosmopolitan/commit/42b34c26f8099658386fc867c49b0b8e59993415\n[Alpine]: https://hub.docker.com/_/alpine\n[jart]: https://justine.lol/\n[pkulchenko]: https://github.com/pkulchenko\n[fullmoon]: https://github.com/pkulchenko/fullmoon\n[Cosmopolitan]: https://github.com/jart/cosmopolitan\n[redbean]: https://redbean.dev/\n[redbean.c]: https://github.com/jart/cosmopolitan/blob/master/tool/net/redbean.c\n[kissgyorgy]: https://github.com/kissgyorgy/redbean-docker\n[02-Nov-2022]: https://github.com/jart/cosmopolitan/commit/5e60e5ad107f0b32d16263ef02dc5090861dc664\n[17-Aug-2024]: https://github.com/jart/cosmopolitan/commit/ca2c30c977be907fec10509cefca15ead314812a\n[really]: https://github.com/jart/cosmopolitan/commit/d3ff48c63f89060844dcfa80f0526b2534dfd56f\n[cool]: https://github.com/jart/cosmopolitan/commit/d50064a779625c4f0f3c4e972b821c2f696cfbad\n[features]: https://github.com/jart/cosmopolitan/commit/d0d027810a87d091f1f7ced1351e59edf05bd2eb\n[bake target]: https://docs.docker.com/build/bake/targets/\n[docker]: https://www.docker.com/\n[podman]: https://podman.io/\n[buildah]: https://buildah.io/\n[Docker Build]: https://docs.docker.com/reference/cli/docker/buildx/build/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw13b3%2Fredbean-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw13b3%2Fredbean-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw13b3%2Fredbean-container/lists"}