From e1af37634b387e18361f15b2db1c7f7f93d37ebc Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 23 Sep 2020 00:38:04 +0200 Subject: doc: Improve code listings By adding prompts and removing unnecessary indentation. --- doc/builders/images/ocitools.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'doc/builders/images/ocitools.xml') diff --git a/doc/builders/images/ocitools.xml b/doc/builders/images/ocitools.xml index e8cd3472f54..f26ed864427 100644 --- a/doc/builders/images/ocitools.xml +++ b/doc/builders/images/ocitools.xml @@ -38,8 +38,7 @@ buildContainer { readonly = false; } - - + -- cgit 1.4.1 From fdc7280a87a8bb0629113a7b0fc6c557158485e5 Mon Sep 17 00:00:00 2001 From: "Bryan A. S" Date: Sun, 10 Jan 2021 02:52:18 -0300 Subject: doc/builders/images/ocitools.xml: Convert to markdown Signed-off-by: Bryan A. S --- doc/builders/images.xml | 2 +- doc/builders/images/ocitools.section.md | 37 ++++++++++++++++++++ doc/builders/images/ocitools.xml | 61 --------------------------------- 3 files changed, 38 insertions(+), 62 deletions(-) create mode 100644 doc/builders/images/ocitools.section.md delete mode 100644 doc/builders/images/ocitools.xml (limited to 'doc/builders/images/ocitools.xml') diff --git a/doc/builders/images.xml b/doc/builders/images.xml index b72fe094db1..d7d25029189 100644 --- a/doc/builders/images.xml +++ b/doc/builders/images.xml @@ -7,6 +7,6 @@ - + diff --git a/doc/builders/images/ocitools.section.md b/doc/builders/images/ocitools.section.md new file mode 100644 index 00000000000..d3dee57ebac --- /dev/null +++ b/doc/builders/images/ocitools.section.md @@ -0,0 +1,37 @@ +# pkgs.ociTools {#sec-pkgs-ociTools} + +`pkgs.ociTools` is a set of functions for creating containers according to the [OCI container specification v1.0.0](https://github.com/opencontainers/runtime-spec). Beyond that it makes no assumptions about the container runner you choose to use to run the created container. + +## buildContainer {#ssec-pkgs-ociTools-buildContainer} + +This function creates a simple OCI container that runs a single command inside of it. An OCI container consists of a `config.json` and a rootfs directory.The nix store of the container will contain all referenced dependencies of the given command. + +The parameters of `buildContainer` with an example value are described below: + +```nix +buildContainer { + args = [ + (with pkgs; + writeScript "run.sh" '' + #!${bash}/bin/bash + exec ${bash}/bin/bash + '').outPath + ]; + + mounts = { + "/data" = { + type = "none"; + source = "/var/lib/mydata"; + options = [ "bind" ]; + }; + }; + + readonly = false; +} +``` + +- `args` specifies a set of arguments to run inside the container. This is the only required argument for `buildContainer`. All referenced packages inside the derivation will be made available inside the container + +- `mounts` specifies additional mount points chosen by the user. By default only a minimal set of necessary filesystems are mounted into the container (e.g procfs, cgroupfs) + +- `readonly` makes the container\'s rootfs read-only if it is set to true. The default value is false `false`. diff --git a/doc/builders/images/ocitools.xml b/doc/builders/images/ocitools.xml deleted file mode 100644 index f26ed864427..00000000000 --- a/doc/builders/images/ocitools.xml +++ /dev/null @@ -1,61 +0,0 @@ -
- pkgs.ociTools - - - pkgs.ociTools is a set of functions for creating containers according to the OCI container specification v1.0.0. Beyond that it makes no assumptions about the container runner you choose to use to run the created container. - - -
- buildContainer - - - This function creates a simple OCI container that runs a single command inside of it. An OCI container consists of a config.json and a rootfs directory.The nix store of the container will contain all referenced dependencies of the given command. - - - - The parameters of buildContainer with an example value are described below: - - - - Build Container - -buildContainer { - args = [ (with pkgs; writeScript "run.sh" '' - #!${bash}/bin/bash - exec ${bash}/bin/bash - '').outPath ]; - - mounts = { - "/data" = { - type = "none"; - source = "/var/lib/mydata"; - options = [ "bind" ]; - }; - }; - - readonly = false; -} - - - - - args specifies a set of arguments to run inside the container. This is the only required argument for buildContainer. All referenced packages inside the derivation will be made available inside the container - - - - - mounts specifies additional mount points chosen by the user. By default only a minimal set of necessary filesystems are mounted into the container (e.g procfs, cgroupfs) - - - - - readonly makes the container's rootfs read-only if it is set to true. The default value is false false. - - - - -
-
-- cgit 1.4.1