> [2/6] RUN mamba install --quiet --yes r-themis==0.1.4 r-rpostgresql==0.6_2 && find / -type f -perm /u+s -ignore_readdir_race -exec chmod u-s {} ; && find / -type f -perm /g+s -ignore_readdir_race -exec chmod g-s {} ;:
#0 6.519 Encountered problems while solving:
#0 6.519 - nothing provides requested r-rpostgresql 0.6_2
#0 6.519 - nothing provides r-rann needed by r-themis-0.1.4-r40hc72bb7e_0
#0 6.519
Apple M1チップ搭載のMacの場合は Docker Desktop 4.4.2 以降
100knocks-preprocess-master/dockerfiles/notebook/Dockerfile
FROM jupyter/datascience-notebook:python-3.10.6
#FROM jupyter/datascience-notebook:d53a302fbcd0
USER root
# mambaでR依存パッケージをインストール
#RUN mamba install --quiet --yes r-themis==0.1.4 r-rpostgresql==0.6_2 \
#RUN mamba install --quiet --yes r-base==3.5 r-themis==0.1.1 r-rpostgresql \
# && find / -type f -perm /u+s -ignore_readdir_race -exec chmod u-s {} \; \
# && find / -type f -perm /g+s -ignore_readdir_race -exec chmod g-s {} \;
USER jovyan
WORKDIR /home/jovyan
COPY Pipfile .
COPY Pipfile.lock .
RUN pip install --upgrade pip \
&& pip install ipython-sql
#RUN pip install --no-cache-dir pipenv==2021.5.29 \
RUN pip install --no-cache-dir psycopg2-binary \
# &&pipenv install --system \
&& rm -rf Pipfile* /tmp/* /var/tmp/*
HEALTHCHECK --interval=5s --retries=20 CMD ["curl", "-s", "-S", "-o", "/dev/null", "http://localhost:8888"]
100knocks-preprocess-master/docker-compose.yml
version: "3.8"
services:
db:
build:
context: .
dockerfile: dockerfiles/postgres/Dockerfile
image: dss-postgres
container_name: dss-postgres
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres12345
- PGPASSWORD=postgres12345
- POSTGRES_DB=dsdojo_db
- DATABASE_HOST=localhost
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./docker/db/init:/docker-entrypoint-initdb.d
- ./docker/work/data:/tmp/data
notebook:
build:
context: .
dockerfile: dockerfiles/notebook/Dockerfile
image: dss-notebook
container_name: dss-notebook
ports:
- "8888:8888"
environment:
- PG_PORT=5432
- PG_USER=padawan
- PG_PASSWORD=padawan12345
- PG_DATABASE=dsdojo_db
- JUPYTER_ENABLE_LAB=yes
depends_on:
db:
condition: service_healthy
volumes:
- ./docker/doc:/home/jovyan/doc
- ./docker/work:/home/jovyan/work
command: start-notebook.sh --NotebookApp.token=''
[+] Running 3/3
⠿ Network 100knocks-preprocess-master_default Created
⠿ Container dss-postgres Healthy
⠿ Container dss-notebook Started
%load_ext sql
import os
pgconfig = {
'host': 'db',
'port': os.environ['PG_PORT'],
'database': os.environ['PG_DATABASE'],
'user': os.environ['PG_USER'],
'password': os.environ['PG_PASSWORD'],
}
dsl = 'postgres://{user}:{password}@{host}:{port}/{database}'.format(**pgconfig)
# MagicコマンドでSQLを書くための設定
%sql $dsl
The sql extension is already loaded. To reload it, use:
%reload_ext sql
Connection info needed in SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys(['postgresql://padawan:***@db:5432/dsdojo_db'])
Can't load plugin: sqlalchemy.dialects:postgres
Connection info needed in SQLAlchemy format, example:
postgresql://username:password@hostname/dbname
or an existing connection: dict_keys(['postgresql://padawan:***@db:5432/dsdojo_db'])
- dsl = 'postgres://{user}:{password}@{host}:{port}/{database}'.format(**pgconfig)
+ dsl = 'postgresql://{user}:{password}@{host}:{port}/{database}'.format(**pgconfig)