美文网首页
docker-使用笔记-1

docker-使用笔记-1

作者: 夜半_月清 | 来源:发表于2021-06-22 10:30 被阅读0次

------------------------------------------------------------------------------------
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

相关文章

网友评论

      本文标题:docker-使用笔记-1

      本文链接:https://www.haomeiwen.com/subject/wlmpyltx.html