···
17
-
description = "OCI image to run.";
17
+
description = lib.mdDoc "OCI image to run.";
example = "library/hello-world";
type = with types; nullOr package;
24
+
description = lib.mdDoc ''
Path to an image file to load before running the image. This can
be used to bypass pulling the image from the registry.
28
-
The <literal>image</literal> attribute must match the name and
28
+
The `image` attribute must match the name and
tag of the image contained in this file, as they will be used to
run the container with that image. If they do not match, the
image will be pulled from the registry as usual.
···
type = with types; nullOr str;
41
-
description = "Username for login.";
41
+
description = lib.mdDoc "Username for login.";
passwordFile = mkOption {
type = with types; nullOr str;
47
-
description = "Path to file containing password.";
47
+
description = lib.mdDoc "Path to file containing password.";
example = "/etc/nixos/dockerhub-password.txt";
type = with types; nullOr str;
54
-
description = "Registry where to login to.";
54
+
description = lib.mdDoc "Registry where to login to.";
example = "https://docker.pkg.github.com";
···
type = with types; listOf str;
63
-
description = "Commandline arguments to pass to the image's entrypoint.";
63
+
description = lib.mdDoc "Commandline arguments to pass to the image's entrypoint.";
example = literalExpression ''
···
type = with types; nullOr str;
71
-
description = "Override the default entrypoint of the image.";
71
+
description = lib.mdDoc "Override the default entrypoint of the image.";
···
type = with types; attrsOf str;
79
-
description = "Environment variables to set for this container.";
79
+
description = lib.mdDoc "Environment variables to set for this container.";
example = literalExpression ''
DATABASE_HOST = "db.example.com";
···
environmentFiles = mkOption {
type = with types; listOf path;
91
-
description = "Environment files for this container.";
91
+
description = lib.mdDoc "Environment files for this container.";
example = literalExpression ''
···
103
+
description = lib.mdDoc ''
Logging driver for the container. The default of
105
-
<literal>"journald"</literal> means that the container's logs will be
105
+
`"journald"` means that the container's logs will be
handled as part of the systemd unit.
For more details and a full list of logging drivers, refer to respective backends documentation.
111
-
<link xlink:href="https://docs.docker.com/engine/reference/run/#logging-drivers---log-driver">Docker engine documentation</link>
111
+
[Docker engine documentation](https://docs.docker.com/engine/reference/run/#logging-drivers---log-driver)
Refer to the docker-run(1) man page.
···
type = with types; listOf str;
121
+
description = lib.mdDoc ''
Network ports to publish from the container to the outer host.
125
+
- `<ip>:<hostPort>:<containerPort>`
126
+
- `<ip>::<containerPort>`
127
+
- `<hostPort>:<containerPort>`
128
+
- `<containerPort>`
129
-
<literal><ip>:<hostPort>:<containerPort></literal>
134
-
<literal><ip>::<containerPort></literal>
139
-
<literal><hostPort>:<containerPort></literal>
144
-
<literal><containerPort></literal>
149
-
Both <literal>hostPort</literal> and
150
-
<literal>containerPort</literal> can be specified as a range of
130
+
Both `hostPort` and `containerPort` can be specified as a range of
ports. When specifying ranges for both, the number of container
ports in the range must match the number of host ports in the
153
-
range. Example: <literal>1234-1236:1234-1236/tcp</literal>
133
+
range. Example: `1234-1236:1234-1236/tcp`
155
-
When specifying a range for <literal>hostPort</literal> only, the
156
-
<literal>containerPort</literal> must <emphasis>not</emphasis> be a
157
-
range. In this case, the container port is published somewhere
158
-
within the specified <literal>hostPort</literal> range. Example:
159
-
<literal>1234-1236:1234/tcp</literal>
135
+
When specifying a range for `hostPort` only, the `containerPort`
136
+
must *not* be a range. In this case, the container port is published
137
+
somewhere within the specified `hostPort` range.
138
+
Example: `1234-1236:1234/tcp`
162
-
<link xlink:href="https://docs.docker.com/engine/reference/run/#expose-incoming-ports">
163
-
Docker engine documentation</link> for full details.
141
+
[Docker engine documentation](https://docs.docker.com/engine/reference/run/#expose-incoming-ports) for full details.
example = literalExpression ''
···
type = with types; nullOr str;
153
+
description = lib.mdDoc ''
Override the username or UID (and optionally groupname or GID) used
···
type = with types; listOf str;
163
+
description = lib.mdDoc ''
List of volumes to attach to this container.
188
-
Note that this is a list of <literal>"src:dst"</literal> strings to
189
-
allow for <literal>src</literal> to refer to
190
-
<literal>/nix/store</literal> paths, which would be difficult with an
191
-
attribute set. There are also a variety of mount options available
192
-
as a third field; please refer to the
193
-
<link xlink:href="https://docs.docker.com/engine/reference/run/#volume-shared-filesystems">
194
-
docker engine documentation</link> for details.
166
+
Note that this is a list of `"src:dst"` strings to
167
+
allow for `src` to refer to `/nix/store` paths, which
168
+
would be difficult with an attribute set. There are
169
+
also a variety of mount options available as a third
170
+
field; please refer to the
171
+
[docker engine documentation](https://docs.docker.com/engine/reference/run/#volume-shared-filesystems) for details.
example = literalExpression ''
···
type = with types; nullOr str;
207
-
description = "Override the default working directory for the container.";
184
+
description = lib.mdDoc "Override the default working directory for the container.";
example = "/var/lib/hello_world";
type = with types; listOf str;
191
+
description = lib.mdDoc ''
Define which other containers this one depends on. They will be added to both After and Requires for the unit.
217
-
Use the same name as the attribute under <literal>virtualisation.oci-containers.containers</literal>.
194
+
Use the same name as the attribute under `virtualisation.oci-containers.containers`.
example = literalExpression ''
virtualisation.oci-containers.containers = {
···
extraOptions = mkOption {
type = with types; listOf str;
232
-
description = "Extra options for <command>${defaultBackend} run</command>.";
209
+
description = lib.mdDoc "Extra options for {command}`${defaultBackend} run`.";
example = literalExpression ''
···
218
+
description = lib.mdDoc ''
When enabled, the container is automatically started on boot.
If this option is set to false, the container has to be started on-demand via its service.
···
type = types.enum [ "podman" "docker" ];
default = if versionAtLeast config.system.stateVersion "22.05" then "podman" else "docker";
342
-
description = "The underlying Docker implementation to use.";
319
+
description = lib.mdDoc "The underlying Docker implementation to use.";
type = types.attrsOf (types.submodule containerOptions);
348
-
description = "OCI (Docker) containers to run as systemd services.";
325
+
description = lib.mdDoc "OCI (Docker) containers to run as systemd services.";