Php-worker容器源问题错误

来自linux中国网wiki
跳到导航 跳到搜索

问题来了

build的时候  The command '/bin/sh -c apt-get update' returned a non-zero code: 100

解决


https://www.cnblogs.com/sunnytrudeau/p/10771607.html
这上面 可以参考得出 版本不对 



login 到已在跑的php-work 发现了 源不对版本  应该是 9.6才对 
root@eb8ca27cc:/etc/apt# cat sources.list
deb http://mirrors.163.com/debian/ stretch main non-free contrib
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
#deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib
#deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
#deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
root@eb8ca:/etc/apt# ls


我的解决思路办法   去掉   还有相关 update 的也要注释掉  
 cat   php-worker/Dockerfile 
#
#--------------------------------------------------------------------------
# Image Setup
#--------------------------------------------------------------------------
#

FROM bluepolaris/php72:v1.1.1

# 1.0.2 增加 bcmath, calendar, exif, gettext, sockets, dba, 
# mysqli, pcntl, pdo_mysql, shmop, sysvmsg, sysvsem, sysvshm 扩展
RUN docker-php-ext-install -j$(nproc) bcmath calendar exif gettext \
sockets dba mysqli pcntl pdo_mysql shmop sysvmsg sysvsem sysvshm

#
#--------------------------------------------------------------------------
# Final Touch
#--------------------------------------------------------------------------
#

# Add supervisord.conf
COPY supervisord.conf /etc/supervisor/supervisord.conf


###########################################################################
# superlance for monitor supervisor
###########################################################################

COPY setuptools-0.6c11-py2.7.egg /tmp/setuptools-0.6c11-py2.7.egg
RUN chmod +x /tmp/setuptools-0.6c11-py2.7.egg
RUN /tmp/setuptools-0.6c11-py2.7.egg

ADD superlance-1.0.0.tar.gz /tmp/
RUN cd /tmp/superlance-1.0.0 && python setup.py install

COPY sendEmail /usr/local/bin/sendEmail

###########################################################################
# Crontab
###########################################################################

RUN rm -f /etc/apt/sources.list 
RUN rm -f /etc/apt/sources.list.d/buster.list 
COPY  sources.list /etc/apt/
RUN  apt update  
RUN  apt-get clean 
RUN  apt-get install -y apt-transport-https
RUN  apt install -y cron vim 
#RUN apt-get install -y vim cron
RUN ["service","cron","start"]

USER root

COPY ./crontab /etc/cron.d

RUN chmod -R 644 /etc/cron.d


USER root

ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c",  "/etc/supervisor/supervisord.conf"]


RUN usermod -u 1000 www-data
#
#--------------------------------------------------------------------------
# Check PHP version
#--------------------------------------------------------------------------
#

RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."

#
#--------------------------------------------------------------------------
# Final Touch
#-------------------------------------------------------------

我添加的源  

/php-worker# cat sources.list
deb http://mirrors.163.com/debian/ stretch main non-free contrib
#deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
#deb http://mirrors.163.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch main non-free contrib
#deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib
#deb-src http://mirrors.163.com/debian/ stretch-backports main non-free contrib
#deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
#deb-src http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib