作りたいもの

a graph image

Docker Compose

https://github.com/kagyuu/docker_ai_study/blob/main/docker-compose.yml

services:
  keras:
    build:
      context: .
      dockerfile: Dockerfile-gpu
      args:
        - PASSWD=${PASSWD}
    ports:
      - '2222:22'
    volumes:
      # $ sudo chown -R 0:0 <host_directory>
      - /var/keras-data:/root/Documents
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              # device_ids: ['0', '3']
              capabilities: [ gpu ]
    #restart: always

  postgres:
    image: postgres:latest
    container_name: postgres
    user: 5050:5050
    volumes:
      # $ sudo chown -R 5050:5050 <host_directory>
      - /var/pgsql-data/initdb.d/:/docker-entrypoint-initdb.d/
      - /var/pgsql-data/data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: root
      POSTGRES_PASSWORD: root
      POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
    hostname: postgres
    #restart: always

  pgadmin4:
    image: dpage/pgadmin4:latest
    container_name: pgadmin4
    volumes:
      # $ sudo chown -R 5050:5050 <host_directory>
      - /var/pgadmin-data:/var/lib/pgadmin
    environment:
      PGADMIN_DEFAULT_EMAIL: root@example.com
      PGADMIN_DEFAULT_PASSWORD: root
      PGADMIN_DISABLE_POSTFIX: "False"
    hostname: pgadmin4
    depends_on:
      - postgres
    #restart: always

 

https://github.com/kagyuu/docker_ai_study/blob/main/Dockerfile-gpu

FROM nvidia/cuda:11.4.1-devel-ubuntu20.04

ARG PASSWD

RUN apt update && apt -y upgrade

# To avoid the command prompt for the timezon setting
ENV DEBIAN_FRONTEND=noninteractive
RUN apt install -y tzdata
ENV TZ=Asia/Tokyo 

# Install Openssh
RUN apt install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:'${PASSWD} | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/#PasswordAuthentication/PasswordAuthentication/' /etc/ssh/sshd_config

# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

# Install Development Environment
RUN apt-get install -y git curl wget vim iputils-ping net-tools lynx bash-completion 
RUN apt-get install -y python3 python3-venv
RUN apt-get install -y postgresql-client
RUN apt-get install -y openjdk-11-jdk maven ant gradle

RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs && node -v
RUN npm install typescript -g

RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python3 - 
RUN echo "export PATH=$PATH:/root/.local/bin" >> /root/.bashrc
RUN /root/.local/bin/poetry --version
RUN /root/.local/bin/poetry completions bash > poetry.bash-completion && mv poetry.bash-completion /etc/bash_completion.d/

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

ビルド

実行

開発環境のVSCode設定

pgadmin4 から postgresql を使う

ssh から postgresql を使う


Docker


添付ファイル: filevscode_keras1.png 14件 [詳細] filevscode_keras2.png 9件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS   sitemap
Last-modified: 2022-01-14 (金) 01:58:16 (7d)
Short-URL: https://at-sushi.com:443/pukiwiki/index.php?cmd=s&k=d1c740caca
ISBN10
ISBN13
9784061426061