1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

dockerでpythonを使う

Last updated at Posted at 2020-03-05
docker pull python
docker run -v C:/:/data --name python -it python /bin/bash
#GPU版
docker run -v $PWD:/working --gpus all --name python -it python:3.8  /bin/bash

#windows用
docker run -v C:/:/working --net host --workdir /working --shm-size=8gb --name python -it python:3.8  /bin/bash

docker run -v $PWD:/working -e DISPLAY=$DISPLAY --net host --gpus all --workdir /working --shm-size=8gb --name python -it python:3.8  /bin/bash

-v ホストにマウントする。
-e 環境変数を設定する。
--net コンテナをネットワークにつなげる
--gpus コンテナにgpuを追加
--name コンテナに名前を付ける
-i インタラプタモード
-t 疑似ttyを割り当てる
python:buster python 3.8.3
bin/bash 使うshell
shm-size 共有メモリ

参考
https://kamino.hatenablog.com/entry/docker_gui
https://qiita.com/chroju/items/ce9cae248cc016745c66
https://docs.docker.com/engine/reference/commandline/run/

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?