{"id":18318546,"url":"https://github.com/maxmind/mmdb-from-go-blogpost","last_synced_at":"2025-04-05T21:32:54.485Z","repository":{"id":45129172,"uuid":"291259154","full_name":"maxmind/mmdb-from-go-blogpost","owner":"maxmind","description":"Enriching MMDB files with your own data using Go.","archived":false,"fork":false,"pushed_at":"2025-03-20T20:31:46.000Z","size":59,"stargazers_count":25,"open_issues_count":1,"forks_count":8,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-21T12:12:41.096Z","etag":null,"topics":["cidr","database","geoip2","geolite2","geolite2-country","ip","maxmind","mmdb"],"latest_commit_sha":null,"homepage":"https://blog.maxmind.com/2020/09/01/enriching-mmdb-files-with-your-own-data-using-go/","language":"Go","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/maxmind.png","metadata":{"files":{"readme":"README-Docker.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2020-08-29T11:34:24.000Z","updated_at":"2025-02-14T20:29:38.000Z","dependencies_parsed_at":"2022-08-26T05:40:57.877Z","dependency_job_id":"bf9e669e-df03-4782-ae76-4bdfe8130ce3","html_url":"https://github.com/maxmind/mmdb-from-go-blogpost","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmind%2Fmmdb-from-go-blogpost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmind%2Fmmdb-from-go-blogpost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmind%2Fmmdb-from-go-blogpost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxmind%2Fmmdb-from-go-blogpost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxmind","download_url":"https://codeload.github.com/maxmind/mmdb-from-go-blogpost/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406080,"owners_count":20933803,"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","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":["cidr","database","geoip2","geolite2","geolite2-country","ip","maxmind","mmdb"],"created_at":"2024-11-05T18:09:58.283Z","updated_at":"2025-04-05T21:32:54.247Z","avatar_url":"https://github.com/maxmind.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker README\n\n\u003c!-- vim-markdown-toc GFM --\u003e\n\n* [Getting Started](#getting-started)\n* [Building Your Docker Container](#building-your-docker-container)\n* [Refactoring Your Code](#refactoring-your-code)\n  * [Mapping your local volume to the Docker container](#mapping-your-local-volume-to-the-docker-container)\n  * [Creating the database](#creating-the-database)\n\n\u003c!-- vim-markdown-toc --\u003e\n\n## Getting Started\n\nA `Dockerfile` has been provided in order to make this code more convenient to run. To get started via `Docker`, you'll need:\n\n* A working Docker environment\n* A `git checkout` of this repository\n* A copy of `GeoLite2-Country.mmdb` in the root of this repository\n\n## Building Your Docker Container\n\nAfter you have checked out this repository and added `GeoLite2-Country.mmdb` to the root directory of the repository, run this command from the root directory. (Linux users may need to preface this command with `sudo`).\n\n```bash\ndocker build . -t mmdb-from-go\n```\n\nThis will build your Docker container, build your `Go` code and also run the example code for you. To log in to your container, run this command. (Linux users may need to preface this command with `sudo`).\n\n```bash\ndocker run -it mmdb-from-go:latest /bin/bash\n```\n\nOnce you have logged in, you can test out your freshly created database:\n\n```bash\nmmdbinspect -db GeoLite2-Country.mmdb \\\n-db GeoLite2-Country-with-Department-Data.mmdb \\\n56.0.0.1 56.1.0.0/24 56.2.0.54 56.3.0.1 | less\n```\n\n## Refactoring Your Code\n\nYou can freely edit the code outside of the Docker container and then re-run it from inside the container. To do so, you'll need to map your local volume to the container and then rebuild the database.\n\n### Mapping your local volume to the Docker container\n```bash\ndocker run -it --volume $(pwd):/project mmdb-from-go:latest /bin/bash\n```\n\n### Creating the database\n\nOnce you are logged in to your container, run the following code:\n\n```bash\ngo build \u0026\u0026 ./mmdb-from-go-blogpost\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmind%2Fmmdb-from-go-blogpost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxmind%2Fmmdb-from-go-blogpost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxmind%2Fmmdb-from-go-blogpost/lists"}