我正在尝试使用 Docker 创建一个包含 eclipse 和一些插件的容器。现在,我正在尝试配置互联网连接所需的代理,它适用于 http,但不适用于 https。我使用 bash 脚本,这是我的文件:
FROM ubuntu:18.04
RUN echo 'Acquire::http::Proxy "http://localhost:8080";' > /etc/apt/apt.conf.d/90curtin-aptproxy && \
echo 'Acquire::https::Proxy "http://localhost:8080";' >> /etc/apt/apt.conf.d/90curtin-aptproxy && \
sed 's/main$/main universe/' -i /etc/apt/sources.list && \
apt-get update && \
apt-get install -y wget openjdk-8-jdk libxext-dev libxrender-dev libxtst-dev libgtk2.0-0 libcanberra-gtk-module zip unzip gnupg2 curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/*
RUN groupadd --gid 1000 user && useradd --uid 1000 --gid 1000 --create-home --shell /bin/bash user
#ENV http_proxy=localhost:8080 https_proxy=localhost:8080
#ADD https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/neon/3/eclipse-java-neon-3-linux-gtk-x86_64.tar.gz&r=1 /tmp/eclipse-java-neon-3-linux-gtk-x86_64.tar.gz
#RUN tar -zxvf /tmp/eclipse-java-neon-3-linux-gtk-x86_64.tar.gz -C /opt/ && \
#rm /tmp/eclipse-java-neon-3-linux-gtk-x86_64.tar.gz
ADD ./eclipse-java-neon-3-linux-gtk-x86_64.tar.gz /opt/
RUN echo "-Dhttp.proxyHost=localhost" >> /opt/eclipse/eclipse.ini && \
echo "-Dhttp.proxyPort=8080" >> /opt/eclipse/eclipse.ini && \
echo "-Dhttps.proxyHost=localhost" >> /opt/eclipse/eclipse.ini && \
echo "-Dhttps.proxyPort=8080" >> /opt/eclipse/eclipse.ini && \
echo "-Dhttp.nonProxyHosts=localhost|127.0.0.1" >> /opt/eclipse/eclipse.ini
COPY launch.sh /
RUN chmod u+x /launch.sh
ENTRYPOINT ["/launch.sh"]
当我运行 eclipse 并进入设置时,http 的代理已设置,但 https 没有任何变化。
你可以帮帮我吗 ?
谢谢你!