vpn

https://blog.csdn.net/weixin_34128534/article/details/86820578

1, compose中的ports改成0.0.0.0

2,config中vpn.sh 宏设置  局域网设置成192.166等不要和168重复

3,helper/run中的ip设置容器的ip

 

dockerfile

FROM centos/python-36-centos7:latest

USER root

RUN yum install -y zlib zlib-devel
RUN yum install -y bzip2 bzip2-devel

RUN yum install -y sqlite sqlite-devel
RUN yum install -y mpich mpich-devel mpich-doc
ENV MPI_ROOT /usr/lib64/mpich
ENV PATH     $MPI_ROOT/bin:$PATH


ENV LC_ALL en_US.UTF-8
ENV PIP_MIRROR https://mirrors.aliyun.com/pypi/simple/

RUN pip3 install -i $PIP_MIRROR  rasa==0.14.0a9
RUN pip3 install -i $PIP_MIRROR authlib
RUN pip3 install -i $PIP_MIRROR distance
RUN pip3 install -i $PIP_MIRROR scrapy
RUN pip3 install -i $PIP_MIRROR hdfs
RUN pip3 install -i $PIP_MIRROR bs4
RUN pip3 install --upgrade pip
RUN pip3 install -i $PIP_MIRROR pyltp
RUN pip3 install -i $PIP_MIRROR pyahocorasick
RUN pip3 install -i $PIP_MIRROR gensim
RUN pip3 install -i $PIP_MIRROR textrank4zh
RUN pip3 install -i $PIP_MIRROR py2neo
RUN pip3 install -i $PIP_MIRROR torch
RUN pip3 install -i $PIP_MIRROR arrow
RUN pip3 install -i $PIP_MIRROR mpi4py
RUN pip3 install -i $PIP_MIRROR asyncio
RUN pip3 install -i $PIP_MIRROR celery-once
RUN pip3 install -i $PIP_MIRROR gaft
RUN pip3 install -i $PIP_MIRROR xgboost==0.81
RUN pip3 install -i $PIP_MIRROR pypinyin
RUN pip3 install -i $PIP_MIRROR pinyin
RUN pip3 install -i $PIP_MIRROR pyfpgrowth
RUN pip3 install -i $PIP_MIRROR Pinyin2Hanzi
RUN pip3 install -i $PIP_MIRROR neo4j==1.7.0
RUN pip3 install -i $PIP_MIRROR pymysql
RUN pip3 install -i $PIP_MIRROR keras
RUN pip3 install -i $PIP_MIRROR scikit-learn
RUN pip3 install -i $PIP_MIRROR celery-redbeat
RUN pip3 install -i $PIP_MIRROR pandas


#安装ssh
RUN yum install -y openssh-server sudo

#生成ssh key
RUN ssh-keygen -t rsa -f /root/.ssh/id_rsa
ADD id_rsa.pub /usr
RUN cat /usr/id_rsa.pub >> /root/.ssh/authorized_keys
RUN mkdir /opt/logs


CMD  /usr/sbin/sshd &


docker network

docker network进行网络设置。

https://docs.docker.com/engine/reference/commandline/network_connect/  官方

 

docker network ls

docker network inspect NETX

docker network connect NETX container

docker network connect –ip 172.18.0.3 NETX container

 

$ docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 multi-host-network