{"id":21067327,"url":"https://github.com/zefhemel/nix-docker","last_synced_at":"2025-06-27T10:34:13.416Z","repository":{"id":11538587,"uuid":"14023361","full_name":"zefhemel/nix-docker","owner":"zefhemel","description":"Provision Docker images using Nix","archived":false,"fork":false,"pushed_at":"2015-01-20T08:36:10.000Z","size":420,"stargazers_count":280,"open_issues_count":8,"forks_count":23,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-03T19:39:38.847Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","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/zefhemel.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}},"created_at":"2013-10-31T17:14:20.000Z","updated_at":"2025-01-02T01:10:01.000Z","dependencies_parsed_at":"2022-09-23T23:33:53.273Z","dependency_job_id":null,"html_url":"https://github.com/zefhemel/nix-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zefhemel/nix-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhemel%2Fnix-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhemel%2Fnix-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhemel%2Fnix-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhemel%2Fnix-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zefhemel","download_url":"https://codeload.github.com/zefhemel/nix-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefhemel%2Fnix-docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262239610,"owners_count":23280366,"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":[],"created_at":"2024-11-19T18:06:32.065Z","updated_at":"2025-06-27T10:34:13.390Z","avatar_url":"https://github.com/zefhemel.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"nix-docker\n==========\n\nUse [NixOS](http://nixos.org/nixos) configurations to provision [Docker](http://docker.io) containers.\n\n[Read about the what and why in this blog post](http://zef.me/6049/nix-docker)\n\nDISCLAIMER: This project is no longer actively maintained and probably broken, if you're interested in fixing it, please fork and contact me: zefhemel@gmail.com\n------------\n\nInstallation with Vagrant\n-------------------------\nThe easy way to do this is to use [Vagrant](http://vagrantup.com).\n\nWhen you have Vagrant installed:\n\n    git clone https://github.com/zefhemel/nix-docker.git\n    cd nix-docker\n    vagrant up\n    vagrant ssh\n\nIf all went well, you're now in a VM that has both Docker and Nix installed\nand `nix-docker` in its path. \n\nAt this point you need to connect to the VM and have nix setup the vagrant users own custom package stores. execute the follow\n\n    nix-channel --update\n    nix-env -i hello\n\nYou can now cd into the nix-docker/samples\ndirectory to try to build some of the examples. Note that the `~/nix-docker`\ndirectory is mounted from your host machine, so you can edit your files with\nyour favorite editor and have them available within the VM.\n\nInstallation\n------------\n\nTo use nix-docker you need [Nix](http://nixos.org/nix) installed as well as\n[Docker](http://www.docker.io). Realistically, your best way to do this on\nan Ubuntu (12.04 or 13.04) box. Once these are installed, installing\n`nix-docker` is as simple as:\n\n    git clone https://github.com/zefhemel/nix-docker.git\n    nix-env -f nix-docker/default.nix -i nix-docker\n\nUsage\n-----\n\nTo build a stand-alone Docker image:\n\n    nix-docker -b -t my-image configuration.nix\n\nThis will build the configuration specified in `configuration.nix`, have a look\nin the `samples/` directory for examples. It will produce a docker image named\n`my-image` which you can then run anywhere. Use `username/my-image` to be able\nto push them to the Docker index.\n\nTo build a host-mounted package:\n\n    nix-docker -t my-image configuration.nix\n\nThis will produce a Nix package (symlinked in the current directory in `result`)\ncontaining a script you can use to spawn the container using Docker, e.g.:\n\n    sudo -E ./result/sbin/docker-run\n\nto run the container in the foreground, or:\n\n    sudo -E ./result/sbin/docker-run -d\n\nto daemonize it. What the `docker-run` script will do is check if there's\nalready a docker image available with the current image name and tag based on\nthe Nix build hash. If not, it will quickly build it first (these images take up\nbarely any space on disk). Then, it will boot up the container.\n\nDistributing host-mounted packages is done by first copying the Nix closure\nresulting from the build to the target machine (when you do the build it\nwill give you example commands to run):\n\n    nix-copy-closure root@targetmachine /nix/store/....\n\nThen, you can spawn the container remotely with the script path provided\nin the output of the build command.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefhemel%2Fnix-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzefhemel%2Fnix-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefhemel%2Fnix-docker/lists"}