gpt4 book ai didi

elasticsearch - docker-compose build 和 http_proxy

转载 作者:IT老高 更新时间:2023-10-28 21:36:09 25 4
gpt4 key购买 nike

我想测试 ELK。它工作正常但是当我想做一个

docker-compose up

在代理之后

docker-compose up --no-recreate 
Building kibana
Step 1 : FROM kibana:latest
---> 544887fbfa30
Step 2 : RUN apt-get update && apt-get install -y netcat
---> Running in 794342b9d807

失败了

W: Some index files failed to download. They have been ignored, or old ones used instead.

没关系

docker build  --build-arg  http_proxy=http://proxy:3128  --build-arg https_proxy=http://proxy:3128 kibana

但是当我重做一个 docker-compose up 时,我尝试重新构建,但无法通过代理

有什么帮助吗?

最佳答案

您将需要 docker-compose 1.6.0-rc1为了通过 docker-compose 将代理传递给您的构建。
commit 47e53b4来自 PR 2653对于 issue 2163 .

Move all build related configuration into a build: section in the service.
Example:

web:
build:
context: .
dockerfile: Dockerfile.name
args:
key: value

作为 mkjeldsen指出 in the comments

If key should assume the value of an environment variable of the same name, value can be omitted (docker-compose ARGS):

Especially useful for https_proxy: if the envvar is unset or empty, the builder will not apply proxy, otherwise it will.

关于elasticsearch - docker-compose build 和 http_proxy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34990458/

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