关于docker:docker构建容器时-容器内使用代理

build 容器时 应用代理

demo1

应用前 指定 env
应用后 记得 清空,  否则 会影响 应用容器 时的 网络

cat dockerfile
-->

FROM jenkins/jenkins:2.289.2-lts-jdk11
USER root

env http_proxy "http://172.20.1.247:7890"
env https_proxy "http://172.20.1.247:7890"

RUN apt-get update && apt-get install -y apt-transport-https \
       ca-certificates curl gnupg2 \
       software-properties-common
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
RUN apt-key fingerprint 0EBFCD88
RUN add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/debian \
       $(lsb_release -cs) stable"
RUN apt-get update && apt-get install -y docker-ce-cli

env http_proxy ""
env https_proxy ""

USER jenkins
RUN jenkins-plugin-cli --plugins "blueocean:1.24.7 docker-workflow:1.26"

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理