Giter Site home page Giter Site logo

Comments (4)

Lingghh avatar Lingghh commented on May 2, 2024

麻烦发一下对Docker-common做了哪些调整哈,我们分析看看

from codeanalysis.

IsME420 avatar IsME420 commented on May 2, 2024

首先遇到的问题是用默认源的化在apt-get update会卡住 可能是网络问题,
截图

然后我就改成了163的源,修改如下:
`FROM python:3.7.12-slim

RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
RUN echo 'deb http://mirrors.163.com/debian/ stretch main non-free contrib' > /etc/apt/sources.list
RUN echo 'deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib' >> /etc/apt/sources.list
RUN echo 'deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib' >> /etc/apt/sources.list

ARG EXTRA_TOOLS="gnupg curl wget jq vim-tiny net-tools procps python3-dev default-libmysqlclient-dev locales inotify-tools gcc subversion git telnet iputils-ping vim openssh-client"

RUN set -ex && cd /
&& apt-get update
&& apt-get install -y --no-install-recommends $EXTRA_TOOLS
&& apt-get update
&& apt-get install -y mariadb-client
&& apt-get clean
&& echo "LC_ALL=zh_CN.UTF-8" >> /etc/environment
&& echo "zh_CN.UTF-8 UTF-8" > /etc/locale.gen
&& echo "LANG=zh_CN.UTF-8" > /etc/locale.conf
&& locale-gen
&& ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime
&& rm -rf /var/cache/apt/* /root/.cache

WORKDIR /var/www/django/codedog

COPY . .

RUN mkdir -p log/ &&
pip install -U setuptools pip &&
pip install -r requirements.txt

`

再执行,apt-get update 这步没问题了
但是到apt-get install -y --no-install-recommends $EXTRA_TOOLS 这步会报依赖错误:
image
试了网上的一些依赖的解决方案,也不行

from codeanalysis.

Lingghh avatar Lingghh commented on May 2, 2024

因为python:3.7.12-slim是基于debian bullseye(debian 11)版本构建的,对应的源需要选择 bullseye版本的源
可以将你的修改替换为以下内容:

RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
    echo 'deb http://mirrors.163.com/debian/ bullseye main non-free contrib' > /etc/apt/sources.list && \
    echo 'deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib' >> /etc/apt/sources.list && \
    echo 'deb http://mirrors.163.com/debian-security bullseye-security main non-free contrib' >> /etc/apt/sources.list

from codeanalysis.

IsME420 avatar IsME420 commented on May 2, 2024

找到原因了,找了一天,我服务器本地时间不对,导致的apt-get update错误,和apt-get的源无关。

from codeanalysis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.