docker summary - arcturus9/useful-link GitHub Wiki
<< ๋์ปค ์คํ ์ต์ข ์์ฝ >>>
(1) ๋์ปค ์ด๋ฏธ์ง ๋ค์ด๋ก๋
docker pull continuumio/anaconda3
(2) ๋์ปค ์คํ (ํ์ฌ ํด๋ ์ฐ๊ฒฐํ๋ ค๋ฉด ํ์ฌํด๋($(pwd)) ์ง์ ์ถ๊ฐ
https://www.slipp.net/wiki/pages/viewpage.action?pageId=26640967
docker run -it -p 8889:8888 continuumio/anaconda3 /bin/bash
docker run -it -p 8888:8888 -v $(pwd):/notebooks continuumio/anaconda3 #ํ์ฌ path๋ฅผ notebookํด๋๋ก ์ฐ๊ฒฐ!
(3) jupyter configํ์ผ ์์ฑ
jupyter lab(notebook) --generate-config
(4) jupyter_notebook_config.py ํ์ผ ์์ (nano ์ค์น ์ํ์ผ๋ฉด apt-get installl nano ์คํํด์ ์ค์น)
https://yahwang.github.io/posts/41
nano /root/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip = '0.0.0.0' # ip ์ค์ ==> '*'๋ก ํ๋ฉด ์๋ฌ๋์ ์๋์์
c.NotebookApp.allow_root = True# root ๊ณ์ ์์ jupyter ์ฌ์ฉ ์ค์ ( ํนํ, docker์ ๊ฒฝ์ฐ)
c.NotebookApp.open_browser = False # jupyter ์คํ ์ ๋ธ๋ผ์ฐ์ ์๋ ์คํ ์ฌ๋ถ
c.NotebookApp.password = '{passwd๋ ํด์ฌ๊ฐ๋ฃ์ด์ค}' ์๋ ์ค๋ช
์ฐธ๊ณ # ๋น๋ฐ๋ฒํธ ์ค์
<๋น๋ฐ๋ฒํธ ํด์ฌ๊ฐ ๋ง๋๋๋ฒ>
>> phthon
>> from notebook.auth import passwd
>> passwd()
Enger password :
Verify password :
'sha1:f98fjdkslffjlkdsjflsdjfldsjflsdf'
c.NotebookApp.password = 'sha1:f98fjdkslffjlkdsjflsdjfldsjflsdf'
==> ๋ค๋์์ผ๋ฉด nano์์ ^O๋ก ์ ์ฅ, ^X๋ก ๋์ด
(5) ๋ธ๋ผ์ฐ์ ์์ localhost:8888 ์คํํด์ ์ ์ ์๋ฃ
(1~5)๊ณผ์ ์ Dockerํ์ผ์ ์ ์ฅํ ํด๋น ํด๋์์ ๋น๋ ์คํ ํ๋ฉด jupyter notebook ๋ฐ๋ก ์ฌ๋ฆด ์ ์์! $ docker build -t app .
(1) ๋์ปค ์ค์น ํ๋๋ฐ, ์ฌ์ฉ์ ๋ณ๊ฒฝ์ด ์๋ ๊ฒฝ์ฐ sudo chmod 666 (or 777) {path/filename.aa}
<<< ๋์ปค cup์ ํ ์ค์ >>> https://github.com/arcturus9/useful-link/wiki/docker-summary
# docker run --name cpuset2 --cpuset-cpus=0,1 -it ubuntu /bin/bash
์ปจํ
์ด๋๊ฐ ์ฌ์ฉํ cpu core ๊ฐฏ์๋ฅผ ํ ๋น ํ ์ ์๋ค.
--cpuset-cpus=0 : 0๋ฒ์งธ cpu ํ๋๋ฅผ ํ ๋นํ๋ค.
--cpuset-cpus=0,1 : 0, 1๋ฒ์งธ cpu๋ฅผ ํ ๋นํ๋ค.