diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-05-12 12:21:48 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-05-15 16:36:21 +0200 |
commit | 247649d42e60b718f3f46b2bcf72d19bf799d503 (patch) | |
tree | fac80f7fe0923c2ba21c0f86210d2d99c0669a3d /doc | |
parent | 7ff4fde257d43760b0df53334b4df63d16491452 (diff) | |
download | patches-247649d42e60b718f3f46b2bcf72d19bf799d503.tar patches-247649d42e60b718f3f46b2bcf72d19bf799d503.tar.gz |
vm: 'system-docker-image' provides an entry point.
This simplifies use of images created with 'guix system docker-image'.
* gnu/system/vm.scm (system-docker-image)[boot-program]: New variable.
[os]: Add it to the GC roots.
[build]: Pass #:entry-point to 'build-docker-image'.
* gnu/tests/docker.scm (run-docker-system-test): New procedure.
(%test-docker-system): New variable.
* doc/guix.texi (Invoking guix system): Remove GUIX_NEW_SYSTEM hack and
'--entrypoint' from the example. Mention 'docker create', 'docker
start', and 'docker exec'.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/guix.texi | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 41ea3c314d..ae9ad0739e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -24500,20 +24500,26 @@ system configuration file. You can then load the image and launch a Docker container using commands like the following: @example -image_id="$(docker load < guix-system-docker-image.tar.gz)" -docker run -e GUIX_NEW_SYSTEM=/var/guix/profiles/system \\ - --entrypoint /var/guix/profiles/system/profile/bin/guile \\ - $image_id /var/guix/profiles/system/boot +image_id="`docker load < guix-system-docker-image.tar.gz`" +container_id="`docker create $image_id`" +docker start $container_id @end example This command starts a new Docker container from the specified image. It will boot the Guix system in the usual manner, which means it will start any services you have defined in the operating system -configuration. Depending on what you run in the Docker container, it +configuration. You can get an interactive shell running in the container +using @command{docker exec}: + +@example +docker exec -ti $container_id /run/current-system/profile/bin/bash --login +@end example + +Depending on what you run in the Docker container, it may be necessary to give the container additional permissions. For example, if you intend to build software using Guix inside of the Docker container, you may need to pass the @option{--privileged} option to -@code{docker run}. +@code{docker create}. @item container Return a script to run the operating system declared in @var{file} |