{"id":16358507,"url":"https://github.com/thebsdbox/microwebstorage","last_synced_at":"2026-05-17T17:42:59.361Z","repository":{"id":146139878,"uuid":"83063045","full_name":"thebsdbox/microWebStorage","owner":"thebsdbox","description":null,"archived":false,"fork":false,"pushed_at":"2017-02-25T18:26:46.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T13:50:28.359Z","etag":null,"topics":["containers","data","docker"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thebsdbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-02-24T16:50:42.000Z","updated_at":"2018-07-25T12:45:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"722f3f51-2904-4016-a04e-2b856cb3f852","html_url":"https://github.com/thebsdbox/microWebStorage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thebsdbox/microWebStorage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebsdbox%2FmicroWebStorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebsdbox%2FmicroWebStorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebsdbox%2FmicroWebStorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebsdbox%2FmicroWebStorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thebsdbox","download_url":"https://codeload.github.com/thebsdbox/microWebStorage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebsdbox%2FmicroWebStorage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266604009,"owners_count":23954725,"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-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["containers","data","docker"],"created_at":"2024-10-11T02:05:59.517Z","updated_at":"2026-05-17T17:42:49.347Z","avatar_url":"https://github.com/thebsdbox.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microWebStorage\n\nAfter a challenge to build the tiniest Docker container appeared on the internet, I decided to see how small I could build a Docker container that served an actual purpose. So I ripped the web server code from my InfraKit plugin and built a tiny binary that will sit on a port and act like a simple webserver allowing data stored with a POST and then retrieved with a GET. \n\nAll data that is passed to the container is held in memory and once the container exits there is nothing left on disk. \n\n## To build\nThe **Makefile** has two `CFLAGS` lines that can be commented/uncommented allowing you to build either a dynamic binary (requires a libc present, more on that later), or a static binary that is completely self contained.\n\nDo a `git clone` of the url above and then change to the directory containing the `Makefile`, edit as needed and then simply do a `make` and a binary will be created. \n\n## Build a container\nAn example Dockerfile below will created a simple tiny Docker container:\n\n```\nFROM scratch\nADD microWebStorage /\nCMD [\"/microWebStorage\"]\n```\n\n```\n$ docker images microwebstorage\nREPOSITORY          TAG                 IMAGE ID            CREATED             SIZE\nmicrowebstorage     latest              28cb98174282        30 minutes ago      14.7 kB\n```\n\n\n## Running the container\n\n### Dynamic binary\nSo the smallest option is the dynamic binary option however it will require a libc in order to run, this dependancy can be resolved because the main host will already need a libc and we can pass it through with `-v /lib64:/lib64:ro` This mapping will ensure that all of the libraries from the OS are present inside the container allowing the binary to run.\n\n### Environment variables\n\n**mwsPort** - *REQUIRED* This is used to specify which port the server will bind too.\n\n**mwsContentType** - This optional variable can be used to specify the Content-Type returned when doing a GET\n\n### Example startup command\nThis will start the container and expose the containers ports on the host itself, we pass in an environment variable to start the container on that particular port and we map the lib64 directory so that libc is present. \n\n`docker run --rm -p 8888:8888 -v /lib64:/lib64:ro -it -e \"mwsPort=8888\" microwebstorage` \n\n## Using the container\nOnce the container is up and running it can make use of simple HTTP **POST** and **GET** commands to store and retrieve data. The container will store this data in memory, so when the container exists any data will be lost. \n\n```\n$ curl -X POST -d '\u003chtml\u003e Hello \u003c/html\u003e' 192.168.0.25:8888\n$ curl 192.168.0.25:8888\n\u003chtml\u003e Hello \u003c/html\u003e\n```\n\nThe application can be used to hold any data (although text data has only been tested so far) and supports the \"EXPECT : 100\" allowing large pieces of data to be uploaded,stored and then retrieved. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebsdbox%2Fmicrowebstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebsdbox%2Fmicrowebstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebsdbox%2Fmicrowebstorage/lists"}