Tor Browserã®Î±çã«ã¯ã»ãã¥ãªãã£ãåä¸ããhardenedçãããããå°ç¨ã®ã¡ã¢ãªé åãå¤ã(4Gããã)確ä¿ããããç°å¢ã«ãã£ã¦ã¯ã¹ã¯ãããã¾ããã§ã¤ãã¤ã®ã§Dockerã§ç°å¢ãéé¢ãã¦åããæ¹æ³ããã£ã¦ã¿ããªã©ããã®ã¯ç§å¯ãé·ãã®ã§ç¶ããèªãããã
ç®æ¬¡
Dockerfileãåæã«å¼ã£ã
dockerfiles/tor-browser/alpha at master · jfrazelle/dockerfiles · GitHub
Docker Hubããæ¢ããã¨ããæ®éã«çºè¦ãããè±èªçããã¦ã³ãã¼ããããã®ã ã£ãã®ã§ãDockerfileããã¯ã£ã¦ãã¦æ¥æ¬èªçããã¦ã³ãã¼ãããããã«ãã¦ã¿ããgitã«ã¯ä¸é¨forkããæ¹æ³ãããã«ã¯ãããããã©ãã®ã§gistã«ä¸ããã
ã¡ãªã¿ã«TOR_LANGã®ã¨ãããå¤ããã¨éãè¨èªã®ãã¼ã¸ã§ã³ãåãããã¨ãã§ããã
tor-browser(Alpha/ja) Dockerfile, forked from http ...
使ã£ã¦ã¿ã
build
é©å½ãªãã£ã¬ã¯ããªã«Dockerfileã¨local.confãæã£ã¦ãã¦ãã«ããããããããæéãæããã
$ docker build -t tor-browser-alpha .
buildã®ãã®å¾ã«
buildãããããrunãããã¨ããã ããéæ³ã®åªæ xauthãªãã¡ãããå±ãã¦å°ç¨ã®Xauthority(èªè¨¼ãã¡ã¤ã«)ãä½ã£ã¦ããrunããããã®éæ³ã®åªæ xauthãªãã¡ãããå±ããªãã¨èµ·åããªã*1ãåªæã®æå¹æéã¯å¤å次ã®åèµ·åã¾ãã¯ãã°ã¤ã³ã¾ã§ã
$ xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f /tmp/.docker.xauth nmerge - xauth: file /tmp/.docker.xauth does not exist #âãã®ã¨ã©ã¼ã¯ç¡è¦ãã¦ãOK
runãã
runæã¯-vãªãã·ã§ã³ã§ãã¹ãã®/tmp/.X11-unix*2ã¨xauthãªãã¡ããã§çæããã/tmp/.docker.xauthãã³ã³ããå´ã«ãã¦ã³ãããåæã«-eãªãã·ã§ã³ã§åºåå
ãã£ã¹ãã¬ã¤ã¨Xauthorityã®å ´æã®æå®ããããããã«ãããã¹ãå´ã«ã³ã³ããå
ã®ã¢ããªã®ã¦ã¤ã³ãã¦ã表示ãããã
/dev/sndã¸ã®ãã¦ã³ãã¯é³ãé³´ããå¿
è¦ããªããã°å¤ãã¦ããããã¨ãããTor Browser使ã£ã¦ã¦é³é³´ããå ´é¢ã£ã¦ããã®ï¼ä¸å¿é³é³´ããããã®ã©ã¤ãã©ãªã¯å
¥ãã¦ãã¿ããã ãã©é³´ããã©ãããããããªãã
$ docker run --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp/.docker.xauth:/tmp/.docker.xauth -v /dev/snd:/dev/snd -e XAUTHORITY=/tmp/.docker.xauth -e DISPLAY=$DISPLAY tor-browser-alpha
ãã°ããããã¨éå§ç»é¢ã表示ãããã®ã§Torãããã¯ã¼ã¯ã«æ¥ç¶ããã°ãã©ã¦ã¶ãèµ·åããã
ã¡ãªã¿ã«
xauthãªãã¡ããã¯xhost +ã§ã代ç¨å¯è½(ãã®å ´å/tmp/.docker.xauth絡ã¿ã®é¨åã¯ä¸è¦)ã ããã¢ã¯ã»ã¹å¶å¾¡æ©è½ã解é¤ããã®ã§ã»ãã¥ãªãã£ä¸ãã¾ãããããã§ããªããããã
èµ·åå¾ã«ã¤ãã¦
ã»ãrunãããã®ä¾ã§ã¯çµäºããã¨ã³ã³ãããã¨ç ´æ£ããããã«ãã¦ãã(--rm)ãããã¯å¥½ã¿ã§ã
ã»ã³ã³ããä¸ã§ã®Tor Browserã¯æ¥æ¬èªå
¥åã§ããªãã®ã§IgoIMEã使ã*3ããã¹ãå´ã§æåå¤æãã¦ã³ãã¼ã¢ã³ããã¼ã¹ããã¹ã(ã¯ãªãããã¼ãã¯å
±ç¨ã§ãã模æ§)ã
*1:ãã®ã¾ã¾ã ã¨docker logsãè¦ã¦ãã¨ã©ã¼ã¡ãã»ã¼ã¸ã¯åºã¦ããªãããDockerfileã®CMDå ã« ,â-vâãä»ãã¦buildârunããã¨logsã«ãã£ã¹ãã¬ã¤ :0ãéããªãæ¨ã®ã¨ã©ã¼ãåãã¦ããã¯ã
*2:ãã¹ãã®Xãµã¼ãã¼ã«ç¹ããUnixãã¡ã¤ã³ã½ã±ããããã
*3:Chasenã®AjaxIMEã¯æåããããããããµã¼ãã¼ã§ã®å¤æãªã®ã§ãã¼ã«ã«å¤æã®IgoIMEãæ¨å¥¨