gpt4 book ai didi

Docker M1 - 使用 Ubuntu + MySQL :/bin/sh errors on latest update Docker Desktop 4. 2.0

转载 作者:行者123 更新时间:2023-12-04 19:26:49 25 4
gpt4 key购买 nike

更新 Docker 后,我正在努力构建我的项目。
我以前工作的 DockerFile:

FROM ubuntu:20.04


ENV DEBIAN_FRONTEND noninteractive
ENV TZ=UTC

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update \
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 \
&& mkdir -p ~/.gnupg \
&& chmod 600 ~/.gnupg \
&& echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf \
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C \
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
&& apt-get update \
&& apt-get install -y php7.4-cli php7.4-dev \
php7.4-pgsql php7.4-sqlite3 php7.4-gd \
php7.4-curl php7.4-memcached \
php7.4-imap php7.4-mysql php7.4-mbstring \
php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap \
php7.4-intl php7.4-readline php7.4-pcov \
php7.4-msgpack php7.4-igbinary php7.4-ldap \
php7.4-redis \
&& php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \
&& curl -sL https://deb.nodesource.com/setup_15.x | bash - \
&& apt-get install -y nodejs \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y yarn \
&& apt-get install -y mysql-client \
&& apt-get install -y postgresql-client \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

使用平台: platform: linux/x86_64在我的 Docker-Compose .
但是,在更新 Docker 后它现在无法正常工作,我不知道为什么。
现在返回以下响应:

After this operation, 116 MB of additional disk space will be used.Get:1 https://deb.nodesource.com/node_15.x focal/main arm64 nodejsarm64 15.14.0-deb-1nodesource1 [24.8 MB] debconf: delaying packageconfiguration, since apt-utils is not installed Fetched 24.8 MB in 2s(12.5 MB/s) Selecting previously unselected package nodejs. (Readingdatabase ... 21576 files and directories currently installed.)Preparing to unpack .../nodejs_15.14.0-deb-1nodesource1_arm64.deb ...Unpacking nodejs (15.14.0-deb-1nodesource1) ... Setting up nodejs(15.14.0-deb-1nodesource1) ... Processing triggers for man-db(2.9.1-1) ... Warning: apt-key output should not be parsed (stdout isnot a terminal) gpg: no valid OpenPGP data found. Segmentation fault 1


error occurred:* Status: The command '/bin/sh -c apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip gitsupervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p~/.gnupg && chmod 600 ~/.gnupg && echo "disable-ipv6" >>~/.gnupg/dirmngr.conf && apt-key adv --homedir ~/.gnupg--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C && apt-key adv --homedir ~/.gnupg --keyserverhkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C && echo "debhttp://ppa.launchpad.net/ondrej/php/ubuntu focal main" >/etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update
&& apt-get install -y php7.4-cli php7.4-dev php7.4-pgsqlphp7.4-sqlite3 php7.4-gd php7.4-curl php7.4-memcached
php7.4-imap php7.4-mysql php7.4-mbstring php7.4-xml php7.4-zipphp7.4-bcmath php7.4-soap php7.4-intl php7.4-readlinephp7.4-pcov php7.4-msgpack php7.4-igbinary php7.4-ldap
php7.4-redis && php -r"readfile('http://getcomposer.org/installer');" | php ----install-dir=/usr/bin/ --filename=composer && curl -sL https://deb.nodesource.com/setup_15.x | bash - && apt-get install-y nodejs && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stablemain" > /etc/apt/sources.list.d/yarn.list && apt-get update &&apt-get install -y yarn && apt-get install -y mysql-client &&apt-get install -y postgresql-client && apt-get -y autoremove
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*'returned a non-zero code: 2, Code: 2


尝试的步骤(指定 Ubuntu 版本以防出现一些不兼容性):
FROM --platform=linux/arm64/v8 ubuntu:18.04

Error 1: Unable to locate package python2

FROM --platform=linux/arm64/v8 ubuntu:21.04

Error 1: The following packages have unmet dependencies: libxml2 :Depends: libicu66 (>= 66.1-1~) but it is not installable php7.4-intl: Depends: libicu66 (>= 66.1-1~) but it is not installable

Error 2: Unable to correct problems, you have held broken packages. 1error occurred: Status: The command '/bin/sh -c [....] returned anon-zero code: 100, Code: 100

FROM --platform=linux/arm64/v8 ubuntu:22.04

Error 1: The following packages have unmet dependencies: libxml2 :Depends: libicu66 (>= 66.1-1~) but it is not installable php7.4-intl: Depends: libicu66 (>= 66.1-1~) but it is not installable

Error 2: Unable to correct problems, you have held broken packages. 1error occurred: Status: The command '/bin/sh -c [....] returned anon-zero code: 100, Code: 100


docker 组成:
我已将我的平台指定为 platform: linux/amd64而不是 platform: linux/x86_64根据文档。尝试使用 linux/arm64但这也不起作用(产生了相同的错误)。

最佳答案

修复它,我昨天晚上是个白痴。
解决方案 A:(就我而言):降级回 Docker Desktop 版本 4.0.0。我使用的是 Intel 图片,所以我必须指定 x86_64。 .
一个更好的解决方案是将我的所有图像更改为基于 Arm64 和 Intel 以及它与 Ubuntu + Mysql 兼容(目前 docker 建议现在使用 MariaDB)
但是 - 看到 Docker 仍然相对不稳定并且可以随时停止您的构建过程,我建议任何人谨慎更新 M1 的 Docker!

关于Docker M1 - 使用 Ubuntu + MySQL :/bin/sh errors on latest update Docker Desktop 4. 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70041787/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com