docker-使用笔记-1
------------------------------------------------------------------------------------
start.txt
cd..
cd analysis
docker-compose up
docker-compose build
------------------------------------------------------------------------------------
Dockerfile
FROM ubuntu:20.04
RUN apt-get -y update && apt-get install -y \
sudo \
unzip \
wget
WORKDIR /opt
RUN wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh && \
sh /opt/Anaconda3-2020.11-Linux-x86_64.sh -b -p /opt/anaconda3 && \
rm -f Anaconda3-2020.11-Linux-x86_64.sh
ENV PATH /opt/anaconda3/bin:$PATH
RUN pip install --upgrade pip
RUN pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ --trusted-host pypi.mirrors.ustc.edu.cn PyMySQL
WORKDIR /work
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root", "--LabApp.token=''"]
------------------------------------------------------------------------------------
docker-compose.yml
version: '3'
services:
analysis:
build: .
ports:
- '8888:8888'
volumes:
- '.:/work'
------------------------------------------------------------------------------------
into docker linux
1.docker-compose up -d
2.docker-compose ps
在这个地方你确认一下表格最左边的"name"
3.docker exec -it "name" /bin/bash
这样你就进去了你docker的linux里边
4.pip3 install xxx
pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ --trusted-host pypi.mirrors.ustc.edu.cn PyMySQL