Wollen Sie mount ein Verzeichnis auf eine Datei (oder Umgekehrt)?

Habe ich ein Andockfenster mit version 17.06.0-ce. Wenn ich versuche zu installieren von nginx mit docker mit dem Befehl:

docker run -p 80:80 -p 8080:8080 --name nginx -v $PWD/www:/www -v $PWD/conf/nginx.conf:/etc/nginx/nginx.conf -v $PWD/logs:/wwwlogs -d nginx:latest

es zeigt, dass

docker: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "process_linux.go:339: container init caused \"rootfs_linux.go:57: mounting \\\"/appdata/nginx/conf/nginx.conf\\\" to rootfs \\\"/var/lib/docker/aufs/mnt/dcea22444e9ffda114593b18fc8b574adfada06947385aedc2ac09f199188fa0\\\" at \\\"/var/lib/docker/aufs/mnt/dcea22444e9ffda114593b18fc8b574adfada06947385aedc2ac09f199188fa0/etc/nginx/nginx.conf\\\" caused \\\"not a directory\\\"\""
: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.

Falls nicht, montieren Sie die nginx.conf - Datei, ist alles in Ordnung. Also, wie kann ich mount die Konfigurationsdatei?

Dank.

Was ist die Ausgabe von ls -al .? Will sehen, was Ihr pwd aussieht.
In meinem Fall hatte ich versehentlich abgebildet ein Verzeichnis vom host auf eine Datei in den container. Neustart ist der container nicht mehr funktioniert. Ich hatte zu entfernen, der Behälter (docker rm …), dann erstellen Sie es neu.

InformationsquelleAutor Steven Luo | 2017-08-31

Schreibe einen Kommentar