Jump to content

Docker: Difference between revisions

Add HOW TO for changing the docker daemon's data-root directory
imported>Camilosampedro
(Without an explicit "backend" option, the oci-containers default to running on "podman". This guide is for docker, so I believe it is expected that these settings run on docker.)
imported>Tsengia
(Add HOW TO for changing the docker daemon's data-root directory)
Line 46: Line 46:
The <code>setSocketVariable</code> option sets the <code>DOCKER_HOST</code> variable to the rootless Docker instance for normal users by default.
The <code>setSocketVariable</code> option sets the <code>DOCKER_HOST</code> variable to the rootless Docker instance for normal users by default.


== docker containers as systemd services ==
=== Changing Docker Daemon's Data Root ===
By default, the Docker daemon will store images, containers, and build context on the root filesystem.
 
If you want to change the location that Docker stores its data, you can configure a new <code>data-root</code> for the daemon by setting the <code>data-root</code> property of the [https://search.nixos.org/options?show=virtualisation.docker.daemon.settings&from=0&size=50&sort=alpha_asc&type=packages&query=virtualisation.docker <code>virtualisation.docker.daemon.settings</code>].
 
<syntaxHighlight lang=nix>
virtualisation.docker.daemon.settings = {
  data-root = "/some-place/to-store-the-docker-data";
};
</syntaxHighlight>
 
== Docker Containers as systemd Services ==


To make sure some docker containers are running as systemd services, you can use 'oci-containers':
To make sure some docker containers are running as systemd services, you can use 'oci-containers':
Anonymous user