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

Enable proxy settings for docker run #1325

Merged
merged 2 commits into from
Jan 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions dockers/docker-sonic-mgmt/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,14 @@ RUN tar -xvzf azure-cli_bundle.tar.gz
RUN azure-cli_bundle_*/installer

RUN git clone https://github.com/Azure/sonic-mgmt

# Forward all proxy settings from 'docker run' command line to container scope startup script.
# So even ssh client has them. All env variables are optional
# Sample command:
# docker run -e "http_proxy=ip1" -e "ftp_proxy=ip2" -it <image>
#
ENTRYPOINT bash -c "touch /etc/profile.d/proxy.sh \
&& echo 'export http_proxy=${http_proxy}' >> /etc/profile.d/proxy.sh \
&& echo 'export https_proxy=${http_proxy}' >> /etc/profile.d/proxy.sh \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http_proxy -> https_proxy

&& echo 'export ftp_proxy=${http_proxy}' >> /etc/profile.d/proxy.sh \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${ftp_proxy}

&& bash"