WSL2èµ·åæã«dockerãèªåèµ·åããã
2024.04.20.追è¨
/etc/wsl.conf
ã®è¨å®ãå¤æ´ãããã¨ã§ã以ä¸ãããã¹ãã¼ãã«å¯¾å¿ã§ãããã¨ãããã£ãã®ã§ããã¡ãã®æ¹æ³ãæ¨å¥¨ããã
ç°å¢
- Windows11
- WSL2
- Ubuntu22
- docker-ce
ã³ã³ããã¹ã
WSL2ä¸ã®Ubuntu22ãèµ·åã®éã«dockerdãèªåèµ·åãããã
ããããWSL2ã¯systemctlã§ã¯ãªãsysvinitã®ãããsudo systemctl enable docker
çãªãã¨ãã§ããªãã
åèï¼
解決æ¹æ³ï¼
~/.bashrc
ã«ä»¥ä¸ã¨ã³ããªã追å ã
if [ $(service docker status | awk '{print $4}') = "not" ]; then sudo service docker start > /dev/null fi
ããã ãã ã¨ãWSL2èµ·åæã«æ¯åPWã®å
¥åãæ±ãããã¦é¢åãªã®ã§ã
/etc/sudoers
ã«ã¨ã³ããªã追å ããã
(1) sudo visudo
(2) 以ä¸ã®åæã®å¤ã %sudo ALL=(ALL:ALL) NOPASSWD:ALL
ã«å¤æ´ããã( NOPASSWD:ALL
ã追è¨ãã)
(3) Ctrl + s
ã§ç·¨éå
容ãä¿åã Ctrl + x
ã§nanoã¨ãã£ã¿ãçµäºã
â»sudoersã®ææ³çã«ä¸æ£ãªç·¨éãããã¨ããã®ã¿ã¤ãã³ã°ã§ä»¥ä¸ã®ã¡ãã»ã¼ã¸ãåºåãããã®ã§ãe
ãå
¥åãã¦ã¨ã©ã¼ç®æãå度修æ£ããã
>>> /etc/sudoers: syntax error near line xx <<< What now?
åèï¼