{"id":18089000,"url":"https://github.com/eriksjolund/podman-mongodb","last_synced_at":"2026-05-01T14:31:35.203Z","repository":{"id":160798183,"uuid":"635618573","full_name":"eriksjolund/podman-mongodb","owner":"eriksjolund","description":"run MongoDB with Podman on macOS","archived":false,"fork":false,"pushed_at":"2023-05-03T06:13:24.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T02:32:16.032Z","etag":null,"topics":["demo","documentation","macos","mongodb","podman"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eriksjolund.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-05-03T04:54:46.000Z","updated_at":"2023-05-24T06:06:11.000Z","dependencies_parsed_at":"2023-06-10T01:45:37.950Z","dependency_job_id":null,"html_url":"https://github.com/eriksjolund/podman-mongodb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eriksjolund/podman-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eriksjolund","download_url":"https://codeload.github.com/eriksjolund/podman-mongodb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriksjolund%2Fpodman-mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32501399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["demo","documentation","macos","mongodb","podman"],"created_at":"2024-10-31T17:42:33.754Z","updated_at":"2026-05-01T14:31:35.160Z","avatar_url":"https://github.com/eriksjolund.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"status: draft documentation, right now untested\n\n# podman-mongodb\n\nRun Mongodb on macOS with Podman.\n\nDocumentation of how to run __docker.io/library/mongodb__ with Podman on macOS and store the MongoDB data directory on the macOS host.\n\n### Examine the container image on a Linux computer\n\nOn a Fedora 38 (Linux) computer find out which UID and GID\nin the container that should be mapped to your regular user.\n\n1. `sudo dnf install podman`\n2. `podman pull docker.io/library/mongo`\n3. run the command\n   ```\n   $ podman image inspect \\\n\t     --format \"user: {{.User}}\" \\\n\t     docker.io/library/mongo\n   user:\n   $\n   ```\n   The User field in the image is not set. This is often a hint\n   that the container image should be started as the container user __root__ (which is the default).\n4. `mkdir datadir`\n5. run the mongodb container\n   ```\n   podman run \\\n       --rm \\\n       -d \\\n       --name mongo \\\n       -p 27017:27017 \\\n       -v ./datadir:/data/db:Z \\\n       docker.io/library/mongo \n   ab27226071714d0e15fe4f08014fd42b2a2fd78813dfde609d933cec62292cac\n   ```\n6. Check which UID and GID ownership the files under the directory _datadir_ have.\n   Run the command\n   ```\n   $ podman unshare ls -ln datadir\n   total 64\n   -rw-------. 1 999 999 4096 May  3 06:39 collection-0-7725828959745876180.wt\n   -rw-------. 1 999 999 4096 May  3 06:39 collection-2-7725828959745876180.wt\n   -rw-------. 1 999 999 4096 May  3 06:39 collection-4-7725828959745876180.wt\n   drwx------. 2 999 999   71 May  3 06:39 diagnostic.data\n   -rw-------. 1 999 999 4096 May  3 06:39 index-1-7725828959745876180.wt\n   -rw-------. 1 999 999 4096 May  3 06:39 index-3-7725828959745876180.wt\n   -rw-------. 1 999 999 4096 May  3 06:39 index-5-7725828959745876180.wt\n   -rw-------. 1 999 999 4096 May  3 06:39 index-6-7725828959745876180.wt\n   drwx------. 2 999 999  110 May  3 06:39 journal\n   -rw-------. 1 999 999 4096 May  3 06:39 _mdb_catalog.wt\n   -rw-------. 1 999 999    2 May  3 06:39 mongod.lock\n   -rw-------. 1 999 999 4096 May  3 06:39 sizeStorer.wt\n   -rw-------. 1 999 999  114 May  3 06:39 storage.bson\n   -rw-------. 1 999 999   50 May  3 06:39 WiredTiger\n   -rw-------. 1 999 999 4096 May  3 06:39 WiredTigerHS.wt\n   -rw-------. 1 999 999   21 May  3 06:39 WiredTiger.lock\n   -rw-------. 1 999 999 1165 May  3 06:39 WiredTiger.turtle\n   -rw-------. 1 999 999 4096 May  3 06:39 WiredTiger.wt\n   ```\n   All the files are owned by the container UID 999 and GID 999.\n   This is good to know when running under macOS\n   because there we need to map UIDs and GIDs so that these files\n   will be stored with the same ownership as the regular user on the host.\n   To do that we will use the command-line option `--userns keep-id:uid=999,gid=999` \n\n### Run Mongodb on macOS with Podman\n\nInstall Podman\n\n1. `brew install podman`\n2. `podman machine init`\n3. `podman machine start`\n\nRun MongoDB\n\n1. `mkdir datadir`\n2.  run the mongo container\n```\npodman -c podman-machine-default \\\n    run \\\n    --rm \\\n    --userns keep-id:uid=999,gid=999 \\\n    -d \\\n    --security-opt label=disable \\\n    --name mongo \\\n    -p 27017:27017 \\\n    -v ./datadir:/data/db \\\n    docker.io/library/mongo \ned8b69089a3d813a44d40f85df9044d0efca6f0720bc1c0dc371edbcba386ccf\n```\n3. optional: verify that the files in the directory _datadir_ are owned by your user and group\n```\n$ find datadir | wc -l\n23\n$ find datadir -not -user $(id -un)\n$ find datadir -not -group $(id -gn)\n```\n\nThere is no _chown_ error\n```\n$ podman -c podman-machine-default logs mongo | grep -i chown\n$\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriksjolund%2Fpodman-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feriksjolund%2Fpodman-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriksjolund%2Fpodman-mongodb/lists"}