Ubuntu - Root Verzeichnis bei Docker ändern

simp^ty

Ensign
Registriert
Jan. 2007
Beiträge
137
Hallo Community,

ich brauche mal eure Hilfe. Ich versuche gerade nach der Neuinstallations meines Servers mit Ubuntu 20.04 das Root-Verzeichnis von Docker zu ändern.
Normal wird es ja unter /var/lib installiert, aber ich möchte es gerne alles unter /data/docker haben.

Dabei habe ich mich an diese und an diese Anleitung gehalten, den Order nach /data/docker verschoben, diese daemon.json mit dem neuen Pfad erstellt, die docker.service Datei geändert und den neuen Pfad mit -g hinzugefügt und Docker neugestartet.

Nur leider lässt sich Docker nicht mehr starten:
1681989190271.png


Ich weiß leider nicht, was das Problem hier ist.

Daher würde ich mich sehr freuen, wenn ihr mir weiterhelfen könnt :)
 
@BoeserBrot Ich habe den Output mal in einen Spoiler gepackt:
-- Logs begin at Thu 2023-04-20 09:43:39 UTC, end at Thu 2023-04-20 12:18:31 UTC. --
Apr 20 09:59:53 oneprovider systemd[1]: Starting Docker Application Container Engine...
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.179220407Z" level=info msg="Starting up"
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.179933124Z" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf"
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.204725968Z" level=info msg="[core] [Channel #1] Channel created" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.204758579Z" level=info msg="[core] [Channel #1] original dial target is: \"unix:///run/containerd/containerd.sock\"" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.204811622Z" level=info msg="[core] [Channel #1] parsed dial target is: {Scheme:unix Authority: Endpoint:run/containerd/containerd.sock URL:{Scheme:unix Opaque: User: Host: Path:/run/containerd/containerd.sock RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.204837999Z" level=info msg="[core] [Channel #1] Channel authority set to \"localhost\"" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.205011507Z" level=info msg="[core] [Channel #1] Resolver state updated: {\n \"Addresses\": [\n {\n \"Addr\": \"/run/containerd/containerd.sock\",\n \"ServerName\": \"\",\n \"Attributes\": {},\n \"BalancerAttributes\": null,\n \"Type\": 0,\n \"Metadata\": null\n }\n ],\n \"ServiceConfig\": null,\n \"Attributes\": null\n} (resolver returned new addresses)" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.205075406Z" level=info msg="[core] [Channel #1] Channel switches to new LB policy \"pick_first\"" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.205127873Z" level=info msg="[core] [Channel #1 SubChannel #2] Subchannel created" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.205165939Z" level=info msg="[core] [Channel #1 SubChannel #2] Subchannel Connectivity change to CONNECTING" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.205203696Z" level=info msg="[core] [Channel #1 SubChannel #2] Subchannel picks a new address \"/run/containerd/containerd.sock\" to connect" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.205209519Z" level=info msg="[core] [Channel #1] Channel Connectivity change to CONNECTING" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.205494124Z" level=info msg="[core] [Channel #1 SubChannel #2] Subchannel Connectivity change to READY" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.205528542Z" level=info msg="[core] [Channel #1] Channel Connectivity change to READY" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206408698Z" level=info msg="[core] [Channel #4] Channel created" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206423151Z" level=info msg="[core] [Channel #4] original dial target is: \"unix:///run/containerd/containerd.sock\"" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206445867Z" level=info msg="[core] [Channel #4] parsed dial target is: {Scheme:unix Authority: Endpoint:run/containerd/containerd.sock URL:{Scheme:unix Opaque: User: Host: Path:/run/containerd/containerd.sock RawPath: OmitHost:false ForceQuery:false RawQuery: Fragment: RawFragment:}}" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206467155Z" level=info msg="[core] [Channel #4] Channel authority set to \"localhost\"" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206502291Z" level=info msg="[core] [Channel #4] Resolver state updated: {\n \"Addresses\": [\n {\n \"Addr\": \"/run/containerd/containerd.sock\",\n \"ServerName\": \"\",\n \"Attributes\": {},\n \"BalancerAttributes\": null,\n \"Type\": 0,\n \"Metadata\": null\n }\n ],\n \"ServiceConfig\": null,\n \"Attributes\": null\n} (resolver returned new addresses)" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206528969Z" level=info msg="[core] [Channel #4] Channel switches to new LB policy \"pick_first\"" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206566121Z" level=info msg="[core] [Channel #4 SubChannel #5] Subchannel created" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206612933Z" level=info msg="[core] [Channel #4 SubChannel #5] Subchannel Connectivity change to CONNECTING" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206646157Z" level=info msg="[core] [Channel #4 SubChannel #5] Subchannel picks a new address \"/run/containerd/containerd.sock\" to connect" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206647878Z" level=info msg="[core] [Channel #4] Channel Connectivity change to CONNECTING" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206829897Z" level=info msg="[core] [Channel #4 SubChannel #5] Subchannel Connectivity change to READY" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.206850057Z" level=info msg="[core] [Channel #4] Channel Connectivity change to READY" module=grpc
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.354329772Z" level=info msg="Loading containers: start."
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.609372629Z" level=info msg="Loading containers: done."
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.647451068Z" level=warning msg="WARNING: No swap limit support"
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.647539498Z" level=info msg="Docker daemon" commit=cbce331 graphdriver=overlay2 version=23.0.4
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.647744631Z" level=info msg="Daemon has completed initialization"
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.698196429Z" level=info msg="[core] [Server #7] Server created" module=grpc
Apr 20 09:59:53 oneprovider systemd[1]: Started Docker Application Container Engine.
Apr 20 09:59:53 oneprovider dockerd[19923]: time="2023-04-20T09:59:53.701676391Z" level=info msg="API listen on /run/docker.sock"
Apr 20 10:05:08 oneprovider dockerd[19923]: time="2023-04-20T10:05:08.559018478Z" level=info msg="Processing signal 'terminated'"
Apr 20 10:05:08 oneprovider systemd[1]: Stopping Docker Application Container Engine...
Apr 20 10:05:08 oneprovider dockerd[19923]: time="2023-04-20T10:05:08.560795372Z" level=info msg="[core] [Channel #1] Channel Connectivity change to SHUTDOWN" module=grpc
Apr 20 10:05:08 oneprovider dockerd[19923]: time="2023-04-20T10:05:08.560876988Z" level=info msg="[core] [Channel #1 SubChannel #2] Subchannel Connectivity change to SHUTDOWN" module=grpc
Apr 20 10:05:08 oneprovider dockerd[19923]: time="2023-04-20T10:05:08.560937455Z" level=info msg="[core] [Channel #1 SubChannel #2] Subchannel deleted" module=grpc
Apr 20 10:05:08 oneprovider dockerd[19923]: time="2023-04-20T10:05:08.560970444Z" level=info msg="[core] [Channel #1] Channel deleted" module=grpc
Apr 20 10:05:08 oneprovider dockerd[19923]: time="2023-04-20T10:05:08.561149564Z" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=libcontainerd namespace=moby
Apr 20 10:05:08 oneprovider dockerd[19923]: time="2023-04-20T10:05:08.562034298Z" level=info msg="Daemon shutdown complete"
Apr 20 10:05:08 oneprovider systemd[1]: docker.service: Succeeded.
Apr 20 10:05:08 oneprovider systemd[1]: Stopped Docker Application Container Engine.
Apr 20 10:06:53 oneprovider systemd[1]: Starting Docker Application Container Engine...
Apr 20 10:06:53 oneprovider dockerd[23842]: Flag --graph has been deprecated, Use --data-root instead
Apr 20 10:06:53 oneprovider dockerd[23842]: unable to configure the Docker daemon with file /etc/docker/daemon.json: merged configuration validation from file and command line flags failed: the "graph" config file option is deprecated; use "data-root" instead
Apr 20 10:06:53 oneprovider systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Apr 20 10:06:53 oneprovider systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 20 10:06:53 oneprovider systemd[1]: Failed to start Docker Application Container Engine.
Apr 20 10:06:55 oneprovider systemd[1]: docker.service: Scheduled restart job, restart counter is at 1.
Apr 20 10:06:55 oneprovider systemd[1]: Stopped Docker Application Container Engine.
Apr 20 10:06:55 oneprovider systemd[1]: Starting Docker Application Container Engine...
Apr 20 10:06:55 oneprovider dockerd[23887]: Flag --graph has been deprecated, Use --data-root instead
Apr 20 10:06:55 oneprovider dockerd[23887]: unable to configure the Docker daemon with file /etc/docker/daemon.json: merged configuration validation from file and command line flags failed: the "graph" config file option is deprecated; use "data-root" instead
Apr 20 10:06:55 oneprovider systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Apr 20 10:06:55 oneprovider systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 20 10:06:55 oneprovider systemd[1]: Failed to start Docker Application Container Engine.
Apr 20 10:06:58 oneprovider systemd[1]: docker.service: Scheduled restart job, restart counter is at 2.
Apr 20 10:06:58 oneprovider systemd[1]: Stopped Docker Application Container Engine.
Apr 20 10:06:58 oneprovider systemd[1]: Starting Docker Application Container Engine...
Apr 20 10:06:58 oneprovider dockerd[23913]: Flag --graph has been deprecated, Use --data-root instead
Apr 20 10:06:58 oneprovider dockerd[23913]: unable to configure the Docker daemon with file /etc/docker/daemon.json: merged configuration validation from file and command line flags failed: the "graph" config file option is deprecated; use "data-root" instead
Apr 20 10:06:58 oneprovider systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Apr 20 10:06:58 oneprovider systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 20 10:06:58 oneprovider systemd[1]: Failed to start Docker Application Container Engine.
Apr 20 10:07:00 oneprovider systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Apr 20 10:07:00 oneprovider systemd[1]: Stopped Docker Application Container Engine.
Apr 20 10:07:00 oneprovider systemd[1]: docker.service: Start request repeated too quickly.
Apr 20 10:07:00 oneprovider systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 20 10:07:00 oneprovider systemd[1]: Failed to start Docker Application Container Engine.
Apr 20 10:07:01 oneprovider systemd[1]: docker.service: Start request repeated too quickly.
Apr 20 10:07:01 oneprovider systemd[1]: docker.service: Failed with result 'exit-code'.
Apr 20 10:07:01 oneprovider systemd[1]: Failed to start Docker Application Container Engine.
-- Reboot --
 
simp^ty schrieb:
Apr 20 10:06:55 oneprovider dockerd[23887]: Flag --graph has been deprecated, Use --data-root instead
Apr 20 10:06:55 oneprovider dockerd[23887]: unable to configure the Docker daemon with file /etc/docker/daemon.json: merged configuration validation from file and command line flags failed: the "graph" config file option is deprecated; use "data-root" instead

Bin zwar kein Docker-Experte, aber ich würde mal da ansetzen.
Die Option "-g" aus dem 2. Link (von 2021) scheint nicht mehr zu existieren.
https://docs.docker.com/engine/reference/commandline/dockerd/

Edit:
Steht auch in den Kommentaren zu dem Artikel:
https://forum.linuxconfig.org/t/how...n-ubuntu-debian-linux-linuxconfig-org/1828/20
 
Fusion.Tio hat vermutlich den Fehler ausfindig gemacht. Ich würde die unit-Datei vom Docker-Service wieder in den Ausgangszustand versetzen und daemon.json so belassen.
 
Also, ich hab's jetzt so gemacht, ich habe das daemon.json wieder gelöscht und nur in das docker.service File das --data-root mit dem neuen Pfad geschrieben.
Der Docker Deamon läuft jetzt, obwohl ich die Meldung mit dem Flag --graph has been deprecated und the "graph" config file option is deprecated immer noch habe. Aber es läuft.
Danke euch!
 
Es is nicht ratsam die units in /lib/systemd/system zu editieren. Diese Dateien werden vom Paketmanager bereitgestellt und können bei Updates wieder überschrieben werden.

Mit der daemon.json kann dir das nicht passieren.

Solltest du dennoch die Service-Datei ändern wollen, dann empfiehlt sich folgendes Vorgehen:
https://wiki.archlinux.org/title/systemd#Drop-in_files
 
  • Gefällt mir
Reaktionen: up.whatever
Zurück
Oben