我正在尝试启动并运行dordoka/tomcat docker镜像,但在运行docker build时遇到以下错误
Cannot add PPA: 'ppa:~webupd8team/ubuntu/y-ppa-manager'.
ERROR: '~webupd8team' user or team does not exist.
The command '/bin/sh -c apt-get update &&
apt-get install -y software-properties-common &&
add-apt-repository -y ppa:webupd8team/y-ppa-manager &&
add-apt-repository -y ppa:webupd8team/ubuntu/y-ppa-manager &&
apt-get update &&
apt-get install -y git build-essential curl wget software-properties-common'
returned a non-zero code: 1失败的命令是add-apt-repository -y ppa:webupd8team/ubuntu/y-ppa-manager。这个命令在docker之外运行得很好。据我所知,代理配置正确。有什么想法吗?
发布于 2018-01-05 23:38:37
@mlowry有没有什么特别的原因让你必须以root用户身份运行?
我假设当你作为你的用户运行它的时候,你也导出了http_proxy?
在这种情况下,您可以使用--build-args来传递http_proxy字符串。
快速示例:
ubuntu@ip-172-31-10-207:~/test$ docker build --build-arg http_proxy=$http_proxy .
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM alpine:latest
---> e21c333399e0
Step 2/4 : ARG http_proxy
---> Running in fd0832692097
Removing intermediate container fd0832692097
---> 4c58ddefe37c
Step 3/4 : RUN export HTTP_PROXY=$http_proxy
---> Running in 913dc802ea8f
Removing intermediate container 913dc802ea8f
---> 9c3280343c13
Step 4/4 : RUN env
---> Running in 0d078193475a
HOSTNAME=0d078193475a
SHLVL=1
HOME=/root
http_proxy=http://domain\user:pass@proxy.com:8080
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/
Removing intermediate container 0d078193475a
---> d4b8996fbb09
Successfully built d4b8996fbb09https://stackoverflow.com/questions/48112206
复制相似问题