New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declaratively running a docker image #37553

coretemp opened this Issue Mar 21, 2018 · 5 comments


None yet
5 participants

coretemp commented Mar 21, 2018

Issue description

It's not really clear to me what the workflow is for running a docker image like for example hosted on ECR. Does one need to run a systemd unit to make this work? Or is there a module where you can just input declaratively what should be running and that's it?

Technical details

NixOS 17.09, but willing to upgrade to 18.03, if needed.


This comment has been minimized.


FRidh commented Mar 22, 2018

I think you can use config.docker-containers to specify containers to run


This comment has been minimized.


coretemp commented Mar 22, 2018

Thank you for answering @FRidh, but I am afraid that your answer is not concrete enough to help me.

@copumpkin The documentation of those options is not usable by me. Can you make it such that it is usable? (Include at the very least an example.)


This comment has been minimized.


bachp commented Mar 25, 2018

@coretemp I use rkt + Systemd to run docker containers on NixOS.
As rkt doesn't have it's own process supervision it integrates nicely with NixOS services.

My config looks like this:

virtualisation.rkt = {
    enable = true;
};"rkt-arango" = {
    description = "ArangoDB (rkt)";
    wantedBy = [ "" ];
    serviceConfig = {
      Slice = "machine.slice";
      ExecStart = ''\
        ${pkgs.rkt}/bin/rkt run --insecure-options=image \
        --port=8529-tcp:8529 --set-env=ARANGO_ROOT_PASSWORD=secret \
        --volume=volume-var-lib-arangodb3,kind=host,source=/var/lib/arango-data,readOnly=false \
        --volume=volume-var-lib-arangodb3-apps,kind=host,source=/var/lib/arango-apps,readOnly=false \
        docker://arangodb \
      KillMode = "mixed";
      Restart = "always";

This comment has been minimized.


davidak commented Mar 25, 2018

FYI: docker-containers was an experimental feature that is removed in 18.03.


This comment has been minimized.


copumpkin commented Mar 25, 2018

Yeah, I merged it by accident, sorry for the confusion 😄 someday I'll get enough time to do it properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment