繁体   English   中英

Docker mysql 映像在使用 Arch ARM 的 Raspberry Pi 上不断失败

[英]Docker mysql image keeps failing on Raspberry Pi with Arch ARM

我有一个 Raspberry Pi 3 Model B,上面安装了 Arch ARM。 我尝试在该设备上通过 Docker 运行 mysql 服务器,但一直无法运行。 这是我的 docker-compose.yml 文件

version: "3.7"
services:
    php73:
        container_name: picloud-ditscheid_php73
        build:
            context: .
            dockerfile: php-fpm73.Dockerfile
        restart: always
        ports:
            - 9000:9000
        volumes:
            - /var/www/vhosts:/var/www/vhosts
    apache:
        container_name: picloud-ditscheid_apache
        image: httpd:2.4
        restart: always
        network_mode: "host"
        volumes:
            - /var/www/vhosts:/var/www/vhosts
            - /var/logs/apache:/var/logs
            - ./apache.conf:/usr/local/apache2/conf/extra/apache.conf
            - ./httpd.conf:/usr/local/apache2/conf/httpd.conf
    mysql:
        container_name: picloud-ditscheid_mysql
        image: arm64v8/mariadb
        command: --default-authentication-plugin=mysql_native_password
        restart: always
        network_mode: "host"
        environment:
            MYSQL_ROOT_PASSWORD: doesntmatter
        volumes:
            - mysqlDb:/var/lib/mysql
volumes:
    mysqlDb:

我收到的错误消息如下:

picloud-ditscheid_apache | [Sun Jun 23 10:44:52.179321 2019] [mpm_event:notice] [pid 1:tid 1995500672] AH00489: Apache/2.4.39 (Unix) configured -- resuming normal operations
picloud-ditscheid_apache | [Sun Jun 23 10:44:52.180252 2019] [core:notice] [pid 1:tid 1995500672] AH00094: Command line: 'httpd -D FOREGROUND'
picloud-ditscheid_mysql | standard_init_linux.go:207: exec user process caused "exec format error"
picloud-ditscheid_php73 | [23-Jun-2019 10:44:55] NOTICE: fpm is running, pid 1
picloud-ditscheid_php73 | [23-Jun-2019 10:44:55] NOTICE: ready to handle connections
picloud-ditscheid_mysql exited with code 1
picloud-ditscheid_mysql | standard_init_linux.go:207: exec user process caused "exec format error"
picloud-ditscheid_mysql | standard_init_linux.go:207: exec user process caused "exec format error"
picloud-ditscheid_mysql | standard_init_linux.go:207: exec user process caused "exec format error"
picloud-ditscheid_mysql exited with code 1
picloud-ditscheid_mysql exited with code 1
Exception in thread Thread-10:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/docker/api/client.py", line 256, in _raise_for_status
    response.raise_for_status()
  File "/usr/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 409 Client Error: Conflict for url: http+docker://localhost/v1.38/containers/d34510381d4b74d5e271ba560be1b787109474bfe31f3a2db784b25fecddaffb/attach?logs=0&stdout=1&stderr=1&stream=1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.7/site-packages/compose/cli/log_printer.py", line 233, in watch_events
    event['container'].attach_log_stream()
  File "/usr/lib/python3.7/site-packages/compose/container.py", line 215, in attach_log_stream
    self.log_stream = self.attach(stdout=True, stderr=True, stream=True)
  File "/usr/lib/python3.7/site-packages/compose/container.py", line 307, in attach
    return self.client.attach(self.id, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/docker/api/container.py", line 61, in attach
    response, stream, self._check_is_tty(container), demux=demux)
  File "/usr/lib/python3.7/site-packages/docker/api/client.py", line 395, in _read_from_socket
    socket = self._get_raw_response_socket(response)
  File "/usr/lib/python3.7/site-packages/docker/api/client.py", line 306, in _get_raw_response_socket
    self._raise_for_status(response)
  File "/usr/lib/python3.7/site-packages/docker/api/client.py", line 258, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/lib/python3.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 409 Client Error: Conflict ("b'container d34510381d4b74d5e271ba560be1b787109474bfe31f3a2db784b25fecddaffb is restarting, wait until the container is running'")

我已经尝试了多个图像 - mysql - mariadb - mysql/mysql-server - mysql/mysql-server:latest-aarch64

使用图像 arm64v8/mariadb 我收到上述错误消息。 使用 mysql 图像,我收到错误消息

ERROR: no matching manifest for unknown in the manifest list entries

我想我知道错误实际上是什么。 我认为 docker 无法弄清楚我的架构实际上是什么,但我无法弄清楚为什么会这样。

经过多次尝试,我在 PI 上找到了一个适用于 Arch Linux 的图像。 我现在正在使用webhippie/mariadb ,它可以做它应该做的事情。 不知道为什么其他人不起作用。

你可以试试:

 mysql:
    image: hypriot/rpi-mysql
    container_name: mysql
    restart: unless-stopped
    tty: true
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: homestead
      MYSQL_USER: homestead
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: secret
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM