运行“docker-compose build”命令时,出现以下错误:
standard_init_linux.go:207: exec user process caused "exec format error"
ERROR: Service 'seafile' failed to build: The command '/bin/sh -c apt-get
update && DEBIAN_FRONTEND=noninteractive apt-get install -y ca-
certificates python2.7 python-setuptools python-imaging python-ldap
python-urllib3 sqlite3 wget' returned a non-zero code: 1
docker-compose.yml:
version: '2'
services:
db:
#image: hypriot/rpi-mysql
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=mdh2019
volumes:
- /mnt/data/mysql:/var/lib/mysql
duply:
build: .
volumes:
- ./config:/config
- /mnt/data:/mnt/data
- ./webinterface:/var/www/html/MyDigitalHome
- /mnt/guestbackup:/mnt/guestbackup/backup
#- /mnt/usb-removable:/usb-removable
ports:
- "8080:80"
- "24:22"
links:
- db
seafile:
build: seafile/
volumes:
- ./seafile/config:/config
- /mnt/data/seafile:/data
ports:
- "8000:8000"
- "8082:8082"
environment:
- [email protected]
- SEAFILE_ADMIN_PW=xxxxxxxx
owncloud:
build: owncloud/
volumes:
- /mnt/data/owncloud:/data
- ./owncloud/config:/var/www/html/config
ports:
- "8090:80"
links:
- db:mysql
mailserver:
build: mailserver/
volumes:
- "./mailserver/dovecot/10-mail.conf:/etc/dovecot/conf.d/10-mail.conf:ro"
- "./mailserver/fetchmail/fetchmailrc:/etc/fetchmailrc:ro"
- "./mailserver/ssl/exim.crt:/etc/ssl/exim.crt:ro"
- "./mailserver/ssl/exim.pem:/etc/ssl/exim.pem:ro"
- "/mnt/data/mailserver:/var/mail"
- "/mnt/data/mailserver/home:/home"
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
- "8079:80"
- "8078:443"
links:
- db
我的 dockerfile 看起来像:
# FROM debian
FROM armv7/armhf-debian
MAINTAINER Me
# install packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates \
python2.7 \
python-setuptools \
python-imaging \
python-ldap \
python-urllib3 \
sqlite3 \
wget
# Copy scripts
ADD ./scripts /scripts
# set environment variables
ENV SERVER_NAME mdh-seafile
ENV SERVER_IP 127.0.0.1
ENV FILESERVER_PORT 8082
ENV SEAFILE_DIR /data
ENV SEAFILE_VERSION seafile-server-6.0.8
ENV INSTALLPATH /opt/seafile/${SEAFILE_VERSION}/
# clean for smaller image
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Volumes for persistent configuration
VOLUME /opt/seafile/
# set entrypoint
ENTRYPOINT bash /scripts/init.sh
我正在使用 docker/Debian 9。
答案1
我解决了它:
需要改变
# FROM debian
FROM armv7/armhf-debian
到:
FROM debian
# FROM armv7/armhf-debian
并评论前面的所有内容# install packages
。这是 Dockerfile 中的树莓派部分。
感谢大家。