我尝试使用arm32v7 / ubuntu:latest来使用一个服务进行docker-compose。
它会遇到第一次RUN apt-get更新,然后以
失败 ERROR: compose.cli.main.main: Service 'app2' failed to build: The command '/bin/sh -c apt-get install -y git' returned a non-zero code: 132
Dockerfile:
FROM arm32v7/ubuntu:latest
RUN apt-get update
RUN apt-get install -y git
RUN apt-get install -y python
RUN apt-get install -y python-dev
RUN apt-get install -y python-setuptools
RUN apt-get install -y python-pip
RUN apt-get install -y nginx
RUN apt-get install -y postgresql
RUN apt-get install -y postgresql-contrib
RUN apt-get install -y supervisor
RUN apt-get install -y sqlite3
RUN pip install -U pip setuptools
RUN rm -rf /var/lib/apt/lists/*
# install uwsgi now because it takes a little while
RUN pip install uwsgi
# setup all the configfiles
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
COPY nginx-app.conf /etc/nginx/sites-available/default
COPY supervisor-app.conf /etc/supervisor/conf.d/
# COPY requirements.txt and RUN pip install BEFORE adding the rest of your code, this will cause Docker's caching mechanism
# to prevent re-installinig (all your) dependencies when you made a change a line or two in your app.
RUN mkdir -p /home/docker/code/app
COPY requirements.txt /home/docker/code/app/
RUN pip install -r /home/docker/code/app/requirements.txt
# add (the rest of) our code
COPY . /home/docker/code/
EXPOSE 80
CMD ["supervisord", "-n"]
有几件我不确定的事情,其中最重要的是在我的RPI上使用ARM32V6和V7。
RPI详细信息:
$ uname -a
Linux black-pearl 4.4.50-hypriotos+ #2 PREEMPT Sun Mar 19 14:44:01 UTC
2017 armv6l GNU/Linux
Docker信息
$ docker info
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 9
Server Version: 17.03.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Kernel Version: 4.4.50-hypriotos+
Operating System: Raspbian GNU/Linux 8 (jessie)
OSType: linux
Architecture: armv6l
CPUs: 1
Total Memory: 370.7 MiB
Name: black-pearl
ID: TJDD:PP7C:44SF:KGBG:UOOF:4PA7:SACD:I4DY:LJSU:5HBO:UFJQ:F2FX
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
答案 0 :(得分:0)
对于RPi2或3,ARMv7应该没问题。 尝试运行docker build --no-cache。使用Dockerfile查看是否仍然发生。也许你有一个过时的缓存层与" apt-get install"必须使用当前数据再次构建的命令。 否则尝试FROM resin / rpi-raspbian,这应该更适合RPi。