Dockerfile设置多个extra-index-url源

设置如下

RUN pip config set global.extra-index-url 'https://xxx.xxx.xxx1/py/simple https://pypi https://xxx.xxx.xxx2/py/simple ……

每个pip源的URL都使用空格分开

我有build了一个容器的,是根据这里面的信息弄的[root@localhost .container]# ll 总计 12 -rw-r--r-- 1 root root 254 7月23日 14:09 docker-compose.yaml -rw-r--r-- 1 root root 829 7月23日 16:32 Dockerfile -rw-r--r-- 1 root root 2436 7月23日 11:20 README.md [root@localhost .container]# cat Dockerfile FROM cr.yandex/mirror/python:3.10 # Install uv and common tools RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib" > /etc/apt/sources.list && \ echo "deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib" >> /etc/apt/sources.list && \ apt-get update && apt-get install -y curl git && \ pip install uvicorn && \ rm -rf /var/lib/apt/lists/* # Set workdir WORKDIR /app/oasis # Copy code COPY . . # Set up venv + install dev deps RUN python3 -m venv .venv && \ . .venv/bin/activate && \ pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \ pip install -e ".[dev]" --timeout=60 && \ pip install pre-commit mypy --timeout=60 && \ pre-commit install # Keep container alive for development CMD ["tail", "-f", "/dev/null"] [root@localhost .container]# cat docker-compose.yaml services: oasis: image: oasis:localdev container_name: oasis-localdev build: context: ../ dockerfile: .container/Dockerfile volumes: - ../:/app/oasis env_file: - .env command: ["tail", "-f", "/dev/null"] [root@localhost .container]#
最新发布
07-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值