Trampni VMda ishlaydigan Docker konteyneriga kirish uchun ishlatmoqchiman.
My Docker bilan bog'liq o'rnatish quyidagi o'xshaydi:
(add-to-list 'tramp-methods
'("docker-exec"
(tramp-login-program "docker")
(tramp-login-args
(("exec" "-ti") ("%h") ("/bin/sh")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-i") ("-c"))))
Men buni idish ichida kataloglarga kirish uchun ishlatishim mumkin, lekin men bunday mashinani "hop" qilishga urinib ko'rganimda: Cx Cf /ssh: root @ vm | docker-exec: ed703f92ae19:/
Tramp birinchi navbatda ls
buyrug'i bilan chalkashib ketadi, chunki u chiziq oxirida ^ M
belgilarni kiritadi va shunday qilib tramp /usr/bin/ls ^ M
kabi bir narsani qaytaradi, bu bekor buyruq yaratadi.
Men buni quyidagicha yengdim:
(defun my/tramp-find-executable
(func vec progname dirlist &optional ignore-tilde ignore-path)
(org-trim (funcall func vec progname dirlist ignore-tilde ignore-path)))
(advice-add 'tramp-find-executable
:around 'my/tramp-find-executable)
Lekin hozir men bu xatoni qabul qilaman:
byte-code: Wrong type argument: number-or-marker-p, //DIRED-OPTIONS//
Va log shunga o'xshash:
//DIRED-OPTIONS// --quoting-style=literal
///c92423c4fd16f4857a1b9d765f804f3e#$
17:32:16.175776 tramp-get-connection-property (7) # check-remote-echo nil
17:32:16.175817 tramp-get-connection-property (7) # check-remote-echo nil
17:32:16.175869 tramp-wait-for-regexp (6) #
total 292
drwxr-xr-x 18 root root 4096 Feb 24 09:08 .
drwxr-xr-x 18 root root 4096 Feb 24 09:08 ..
-rwxr-xr-x 1 root root 0 Feb 24 09:08 .dockerenv
-rwxr-xr-x 1 root root 0 Feb 24 09:08 .dockerinit
lrwxrwxrwx 1 root root 7 Mar 30 2015 bin -> usr/bin
<<< skipped >>>
drwxrwxrwt 2 root root 4096 Feb 24 15:29 tmp
drwxr-xr-x 13 root root 4096 Mar 30 2015 usr
drwxr-xr-x 18 root root 4096 Mar 30 2015 var
//DIRED// 59 60 108 110 158 168 216 227 275 278 337 340 388 391 439 443 491 494 553 558 619 629 677 682 730 733 781 784 832 836 884 888 936 939 987 991 1051 1058 1106 1109 1157 1160 1208 1217 1265 1268 1316 1319 1367 1370
//DIRED-OPTIONS// --quoting-style=literal
///c92423c4fd16f4857a1b9d765f804f3e#$
Tramp bu xatoni olganida nima qilmoqchi ekanini bilmayman, shuning uchun buni tuzatishning yo'lini o'ylay olmayman. Lekin, ehtimol bu ma'lum bir xatomi? Yoki Tramp uchun ^ M
s ni qo'shmasligi uchun qo'shimcha sozlamalar kerak bo'lishi mumkinmi? (Ikkala mashina ham Linuxni, ham CentOSni ishlasa-da, ular asl nusxada ekanligiga shubhamiz yo'q.