Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac 下报错 , apt-get update -yqq 无法执行 #2358

Closed
310898026 opened this issue Nov 7, 2019 · 12 comments
Closed

mac 下报错 , apt-get update -yqq 无法执行 #2358

310898026 opened this issue Nov 7, 2019 · 12 comments
Labels
GFW Global Firewall Stale

Comments

@310898026
Copy link

---> Running in 9f40413d672a

@sleepm
Copy link

sleepm commented Nov 7, 2019

是因为网络问题,开代理就好了

@310898026
Copy link
Author

已经开代理了, mac,下好像没有 apt-get 这个命令,为什么会执行

@310898026
Copy link
Author

是因为网络问题,开代理就好了
已经开代理了, mac,下好像没有 apt-get 这个命令,为什么会执行

@sleepm
Copy link

sleepm commented Nov 7, 2019

是因为网络问题,开代理就好了
已经开代理了, mac,下好像没有 apt-get 这个命令,为什么会执行

dockerfile里的命令都是在容器里执行的
代理在 docker desktop 里有设置,或者命令行设置
export http_proxy='http://192.168.3.3:1087'
export https_proxy='http://192.168.3.3:1087'
不建议127.0.0.1:1087 是因为容器里读到的代理地址也是127.0.0.1

@sleepm
Copy link

sleepm commented Nov 7, 2019

系统代理
终端 shell 代理
应用代理
是三个不同的设置

@310898026
Copy link
Author

多谢,虽然我没明白,容器内怎么配置,使用宿主机代理,但是我把registry mirrors 的地址,复制到proxies里,好像还是好了,但还是报错了

Verifying integrity...
gpg: keyring `/home/laradock/.gnupg/secring.gpg' created
gpg: key 86E50310: public key "Yarn Packaging yarn@dan.cx" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
gpg: Signature made Tue 08 Oct 2019 11:36:57 AM UTC using RSA key ID 69475BAA
gpg: BAD signature from "Yarn Packaging yarn@dan.cx"
GPG signature for this Yarn release is invalid! This is BAD and may mean the release has been tampered with. It is strongly recommended that you report this to the Yarn developers.
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTALL_YARN} = true ]; then [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && if [ ${YARN_VERSION} = "latest" ]; then curl -o- -L https://yarnpkg.com/install.sh | bash; else curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; fi && echo "" >> ~/.bashrc && echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc ;fi' returned a non-zero code: 1
adeMacBook-Pro:laradock a$

@sleepm
Copy link

sleepm commented Nov 9, 2019

在Dockerfile中找需要代理的地方,在前面加
RUN export http_proxy='http://192.168.3.3:1087'
RUN export https_proxy='http://192.168.3.3:1087'
比如 yarn install
apt的代理有些特殊,需要改
/etc/apt/apt.conf.d/proxy.conf
RUN echo 'Acquire::http::Proxy "http://user:password@proxy.server:port/";' >>/etc/apt/apt.conf.d/proxy.conf
RUN echo 'Acquire::https::Proxy "http://user:password@proxy.server:port/";'>>/etc/apt/apt.conf.d/proxy.conf

系统代理是系统上设置的,但是终端比较调皮,终端里的shell不认系统代理,需要export设置变量,设置完也只是在当前shell当前标签页可用
应用内代理,就比如chrome有switchyomega插件设置,插件设置直连,那会就直接无视系统代理
所以是三个不同的代理

@310898026
Copy link
Author

在Dockerfile中找需要代理的地方,在前面加
RUN export http_proxy='http://192.168.3.3:1087'
RUN export https_proxy='http://192.168.3.3:1087'
比如 yarn install
apt的代理有些特殊,需要改
/etc/apt/apt.conf.d/proxy.conf
RUN echo 'Acquire::http::Proxy "http://user:password@proxy.server:port/";' >>/etc/apt/apt.conf.d/proxy.conf
RUN echo 'Acquire::https::Proxy "http://user:password@proxy.server:port/";'>>/etc/apt/apt.conf.d/proxy.conf

系统代理是系统上设置的,但是终端比较调皮,终端里的shell不认系统代理,需要export设置变量,设置完也只是在当前shell当前标签页可用
应用内代理,就比如chrome有switchyomega插件设置,插件设置直连,那会就直接无视系统代理
所以是三个不同的代

好详细,多谢哈

@pabloleone
Copy link

pabloleone commented Nov 19, 2019

I've restarted Docker for mac and then I've executed the following command:

docker-compose build --no-cache nginx mysql

It worked! BUT it didn't do what I expected! :(

I've then went to the Dockerfile and removed the line that was causing the issue and the image build worked.

@bestlong bestlong added the GFW Global Firewall label Nov 30, 2019
@amorZhu
Copy link
Contributor

amorZhu commented Nov 30, 2019

解决 Laradock 拉取镜像并创建容器时非常慢的问题

@stale
Copy link

stale bot commented Feb 28, 2020

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs. Thank you for your contributions ❤️.

@stale stale bot added the Stale label Feb 28, 2020
@stale
Copy link

stale bot commented Mar 20, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GFW Global Firewall Stale
Projects
None yet
Development

No branches or pull requests

5 participants