docker-compose up --build,在高山容器中安装pip软件包时卡住

时间:2019-08-23 10:29:11

标签: python pip docker-compose alpine

在高山中安装软件包会卡住

它停留在 (6/12) Installing ncurses-terminfo (6.1_p20190105-r0) OR (10/12) Installing python2 (2.7.16-r1)

有时它可以正常工作。

命令:sudo docker-compose build

尝试使用代理,但没有成功

    # Docker Upstart and SysVinit configuration file

    #
    # THIS FILE DOES NOT APPLY TO SYSTEMD
    #
    #   Please see the documentation for "systemd drop-ins":
    #   https://docs.docker.com/engine/admin/systemd/
    #

    # Customize location of Docker binary (especially for development testing).
    #DOCKERD="/usr/local/bin/dockerd"

    # Use DOCKER_OPTS to modify the daemon startup options.
    DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"

    # If you need Docker to use an HTTP proxy, it can also be specified here.
    export http_proxy="http://127.0.0.1:3128/"

    # This is also a handy place to tweak where Docker's temporary files go.
    #export DOCKER_TMPDIR="/mnt/bigdrive/docker-tmp"

还尝试通过创建MTU docker-compose.yml

  version: '3.7'

  services:

    admin-api:
      container_name: admin-api
      build:
        context: .
        dockerfile: Dockerfile

      environment:
        - HOME=/home
        - NODE_ENV=dev
        - DB_1=mongodb://mongo:27017/DB_1
        - DB_2=mongodb://mongo:27017/DB_2
      volumes:
        - '.:/app'
        - '/app/node_modules'
        - '$HOME/.aws:/home/.aws'
      ports:
        - '4004:4004'
      networks:
        - backend
      links:
        - mongo

    mongo:
      container_name: mongo
      image: mongo:4.2.0-bionic
      ports:
        - "27018:27017"
      networks:
        - backend

  networks:
      backend:
        driver: bridge
        driver_opts:
          com.docker.network.driver.mtu: 1500

Dockerfile

    # base image
    FROM node:8.16.1-alpine

    # set working directory
    WORKDIR /app

    # add `/app/node_modules/.bin` to $PATH
    ENV PATH /app/node_modules/.bin:$PATH

    # install and cache app dependencies
    COPY package.json /app/package.json

    RUN apk add --update-cache py-pip && \
        pip install awscli && \
        apk --purge -v del py-pip && \
        rm -rf /var/cache/apk/*

    RUN npm install --silent
    RUN npm install -g nodemon

    # start app
    CMD  nodemon

    EXPOSE 4004

我的工作依赖于AWS​​,并且需要AWS凭证,我使用pip安装了AWS,并使用/home/.aws (local)容器安装了/home/.aws,但是在创建或构建容器时,它卡住了,并且没有没有显示任何错误。在构建容器时,我还检查了网络监视器,它显示接收到数据包0 bytes/s

尝试过--verbose,但没有得到任何有用的信息

0 个答案:

没有答案