-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bcbaf0
commit 4e3e6c1
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Jupyter LabのためのDockerコンテナ | ||
|
||
Dockerが動作する環境を前提とします. | ||
|
||
注意:macOSでも動作を確認していますが,2024年4月の時点で,Dockerイメージwolframresearch/wolframengineのプラットフォームがlinux/amd64だけでなので,性能は悪いかもしれません. | ||
|
||
## 目標 | ||
|
||
Python, R, Wolfram言語が使えるJupyter Labを,Dockerコンテナで提供します. | ||
|
||
コンテナを構築は次のように構築できるようになります(`pass`はパスワード(変更可).Ctrl-Cで終了). | ||
|
||
```bash | ||
docker run --rm -it -v $(pwd):/home/wolframengine/work -e PASS=pass -p 8888:8888 comath | ||
``` | ||
|
||
ブラウザでhttp://localhost:8888 にアクセスして使えるようになります(計算が途中で止まったようにみえるときは,Kernel→Restart Kernel). | ||
|
||
 | ||
|
||
/home/wolframengine/work に保存したファイルはホストに保存されるようになります. | ||
|
||
## 準備 | ||
|
||
### Wolfram Engineの有効化 | ||
|
||
Wolfram IDがない場合は https://account.wolfram.com/login/create で作ってから先に進みます. | ||
|
||
Wolfram Engineを有効化して,Licensing/mathpassを作ります.そのために,適当な作業ディレクトリで,次を実行します. | ||
|
||
```bash | ||
mkdir Licensing | ||
docker run -it wolframresearch/wolframengine | ||
``` | ||
|
||
Wolfram IDとパスワードを入力すると有効化されます(参考:https://hub.docker.com/r/wolframresearch/wolframengine ). | ||
|
||
``` | ||
> docker run -it wolframresearch/wolframengine | ||
The Wolfram Engine requires one-time activation on this computer. | ||
Visit https://wolfram.com/developer-license to get your free license. | ||
Wolfram ID: [email protected] | ||
Password: | ||
Wolfram Engine activated. See https://www.wolfram.com/wolframscript/ for more information. | ||
Wolfram Language 12.2.0 Engine for Linux x86 (64-bit) | ||
Copyright 1988-2020 Wolfram Research, Inc. | ||
In[1]:= $PasswordFile | ||
Out[1]= /home/wolframengine/.WolframEngine/Licensing/mathpass | ||
In[2]:= $PasswordFile // FilePrint | ||
1e1d781ed0a3 6520-03713-97466 4304-2718-2K5ATR 5095-179-696:2,0,8,8:80001:20190627 | ||
In[3]:= Quit | ||
``` | ||
|
||
テキストファイルLicensing/mathpassを作り,`In[2]`の結果,上の例では`1e1d...627`を貼り付けて保存します. | ||
|
||
ディレクトリ構造は次のとおりです. | ||
|
||
``` | ||
. | ||
└── Licensing | ||
└── mathpass | ||
``` | ||
|
||
Wolfram Engineの動作を確認します(`Quit`で終了). | ||
|
||
```bash | ||
docker run --rm -it -v ./Licensing:/usr/share/WolframEngine/Licensing wolframresearch/wolframengine | ||
``` | ||
|
||
## イメージ構築 | ||
|
||
Python, R, Wolfram Engineを使えるJupyter LabのDockerイメージを構築します([Dockerfile](https://raw.githubusercontent.com/taroyabuki/comath/main/docker/Dockerfile)). | ||
|
||
```bash | ||
docker run --rm curlimages/curl https://raw.githubusercontent.com/taroyabuki/comath/main/docker/Dockerfile \ | ||
| docker build -t comath -f- . | ||
``` | ||
|
||
補足:aptのプロキシがある環境では,次のようにプロキシを指定します. | ||
|
||
```bash | ||
docker run --rm curlimages/curl https://raw.githubusercontent.com/taroyabuki/comath/main/docker/Dockerfile \ | ||
| docker build -t comath --build-arg APT_PROXY=http://10.100.192.10:3142 -f- . | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.