통상적으로 문제는 없다. Ray를 실행할 때마다 shm 용량 문제에 대한 경고 메세지를 계속 보게 된다. 그래서 copilot에게 물어봤다. 중간에 확장하는 방법은 없지만, 기존 환경을 유지하면서 새롭게 확장하는 방법은 알려주었다.

포트 지정 등은 해주어야 한다.
통상적으로 문제는 없다. Ray를 실행할 때마다 shm 용량 문제에 대한 경고 메세지를 계속 보게 된다. 그래서 copilot에게 물어봤다. 중간에 확장하는 방법은 없지만, 기존 환경을 유지하면서 새롭게 확장하는 방법은 알려주었다.
포트 지정 등은 해주어야 한다.
sudo docker network create work
## Working container
sudo docker rm -f stock
sudo docker run -it --name stock --restart always --network work -p 3838:3838 debian
#sudo docker run -it --name stock --restart always --network work -p 8888:8888 -p 8787:8787 -p 3838:3838 debian
echo 'Acquire::http::Proxy "http://rcc.work:3142";' > /etc/apt/apt.conf
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
apt-get -y update && apt-get -y upgrade
apt-get -y install apt-utils dialog curl nano sudo procps cron
cd ~; mkdir -p ~/.local; mkdir -p ~/.pip; curl -s http://rcc.work:3143/pip.conf > ~/.pip/pip.conf
apt-get -y install python3 python3-pip
pip3 install --break-system-packages jupyterlab
jupyter lab --generate-config
from jupyter_server.auth import passwd; passwd()
# jupyter-lab --ip=* --allow-root
###### R
apt-get -y install r-base gdebi
curl -O http://rcc.work:3143/rstudio-server-2023.12.0-369-amd64.deb
curl -O http://rcc.work:3143/libssl1.1_1.1.1w-0+deb11u1_amd64.deb
dpkg -i libssl1.1_1.1.1w-0+deb11u1_amd64.deb
gdebi rstudio-server-2023.12.0-369-amd64.deb
export LD_LIBRARY_PATH = /usr/lib64/x86_64-linux-gnu/:$LD_LIBRARY_PATH
## DB
sudo docker rm -f db
sudo docker run -it --name db --restart always --network work --net=host debian
echo 'Acquire::http::Proxy "http://rcc.work:3142";' > /etc/apt/apt.conf
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
apt-get -y update && apt-get -y upgrade
apt-get -y install apt-utils dialog curl nano sudo procps
apt-get -y install postgresql
echo 'cd /root' >> ~/.bashrc
echo 'service postgresql start' >> ~/.bashrc
echo '/root/postgrest /root/postgrest.conf &' >> ~/.bashrc
echo 'db-uri = "postgres://postgres:postgres@localhost:5432/postgres"' > /root/postgrest.conf
echo 'db-schema = "db"' >> /root/postgrest.conf
echo 'db-anon-role = "postgres"' >> /root/postgrest.conf
###
sudo -i -u postgres psql postgres
\password postgres
create schema db;
create table db.stock_list();
alter table db.stock_list add name text;
alter table db.stock_list add market text;
insert into db.stock_list (name, market) values ('IBM', 'NYSE');
insert into db.stock_list (name, market) values ('PFE', 'NYSE');
create table db.stock_trend();
alter table db.stock_trend add name text;
alter table db.stock_trend add date date;
alter table db.stock_trend add price double precision;
sudo docker rm -f rstudio
sudo docker run -it \
--name rstudio \
--restart always \
--dns 8.8.8.8 \
-p 8788:8787 \
--add-host rcc.work:192.168.126.37 \
debian
echo 'Acquire::http::Proxy "http://rcc.work:3142";' > /etc/apt/apt.conf
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
apt-get -y update && apt-get -y upgrade
apt-get -y install dialog gpg wget locales
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B8F25A8A73EACF41
gpg --keyserver keyserver.ubuntu.com \
--recv-key '95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7'
echo 'deb http://cloud.r-project.org/bin/linux/debian bookworm-cran40/' >> /etc/apt/sources.list
#ttps://debian.pkgs.org/11/debian-main-amd64/libssl1.1_1.1.1w-0+deb11u1_amd64.deb.html
wget http://ftp.de.debian.org/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0+deb11u1_amd64.deb
도커는 기본적으로 포트가 격리되어 있다.
블로그 이전 과정에서 이 포트 문제를 가장 쉽게 해결하기 위해서 호스트 상태와 같은 형태로 유지해보기로 했다. –net host를 이용하면 호스트에서 동작하는 것처럼 포트를 이용할 수 있다. 외부에 노출되어 있는 포트가 많다. 보안이 취약해 질 수 있다.
sudo docker run -it --net host --name blog2 debian