0
0

More than 1 year has passed since last update.

RAFTの環境をdocker-composeで作る。

Last updated at Posted at 2022-06-02

これのdocker-composeで環境を作る時の設定
グラボが無いので、動作確認とかはできない。ごめんね。
docker立ち上げるまでは後で修正するかも。
以下を参考にした。

tree
.
- build-env
  - Dockerfile
  - requirements_conda.txt
- project
  - pythonファイルなど
- docker-compose.yml
docker-compose.yml
version: '3'

services:
  project_name:
    container_name: 'project_name'
    build: 
      context: ./build-env
      dockerfile: DockerFile
    image: image_name:tag_name
    tty: true
    volumes:
      - ./project:usr/src/project_name
    runtime: nvidia
    shm_size: '2gb'
Dockerfile
FROM pytorch/pytorch:1.6.0-cuda10.1-cudnn7-devel

# NVIDIA pubkey更新
RUN rm -f /etc/apt/sources.list.d/cuda.list \
 && apt-get update && apt-get install -y --no-install-recommends \
    wget \
 && distro=$(. /usr/lib/os-release; echo $ID$VERSION_ID | tr -d ".") \
 && arch=$(/usr/bin/arch) \
 && wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.0-1_all.deb \
 && dpkg -i cuda-keyring_1.0-1_all.deb \
 && rm -f cuda-keyring_1.0-1_all.deb

RUN apt-get install -y vim less unzip
WORKDIR /usr/src/project_name

COPY . .

apt-get updateのエラー(NVIDIA pubkey更新について)

最近更新されたらしい。古いバージョンを使う場合は今後も世話になる。

build-env

特にイメージを作り直すときにはまる。
https://stackoverflow.com/questions/26600769/build-context-for-docker-image-very-large

おわりに

画像処理用のグラボ欲しいとか思ったが、Google Coraboratoryが優秀なので、そっちで頑張ろうかなと思う。

0
0
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
0
0