Comments (8)
I actually stumped on this the other day: use ARG
during the build. More details here: https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables-build-arg
Taken from the link above: $ docker build --build-arg HTTP_PROXY=http://10.20.30.2:1234 .
I think this fits your scenario.
from alpine-python.
I would like to second using the --build-arg
flag instead of ENV in the Dockerfile. By setting the --build-arg
correctly, you set the environment variable only for build time.
By setting the environment variables within the Dockerfile, you are saying that it will always have to use those proxy settings (it's not so easy to unset an environment variable in docker), even in a running container, or any derivative images.
I got caught by this one yesterday.
from alpine-python.
from alpine-python.
I would like to reopen threads like this one but requiring an answer that allows another person to run the same image without modifying and rebuilding from Dockerfile.
ENV in Dockerfile is so local, hacky and non portable it cripples Docker to uselessness in corporations.
Also incomplete since I assume you also will need a proxy to get your base image.
I expect proxy on host talks or something level of conversation to reach a solution.
from alpine-python.
Nice question. A quick google search gave me these discussions at the official Alpine docker image:
Do you think you could test this approach with a custom Dockerfile and provide feedback?
from alpine-python.
Were you able to reach a solution @javixeneize ?
from alpine-python.
Hi. Sorry, yes, it works fine configuring the proxy inside
Thanks
from alpine-python.
Could you give some details on how you made it? Maybe write those instructions in the README and PR?
from alpine-python.
Related Issues (20)
- libffi / ffi.h issue on alpine-python:3.6-onbuild HOT 5
- jfloff/alpine-python:2.7-slim increased from 58.8MB to 96.9MB HOT 9
- [BUG] Incorrect path for python binaries HOT 2
- Shared libraries not found since last commit HOT 1
- gcc no file or dir HOT 1
- getting error with tzdata and apscheduler library HOT 7
- more information about where the python console error and out go HOT 2
- Tensorflow not supported for jfloff/alpine-python:3.6-onbuild ? HOT 4
- New images based upon your work HOT 1
- 3.7 and 3.7-slim command 'gcc' failed. HOT 4
- Packages purging HOT 19
- Passing a repository during install of pip dependencies HOT 2
- Quay Support HOT 3
- Alpine upgrade to latest HOT 1
- /bin/sh: /entrypoint.sh: not found 3.7 tag. HOT 1
- Usage text is never printed
- Support Python 3.8
- Build deps removal dilemma HOT 1
- Update to Alpine 3.11 on 2.7 python images with same tag
- PYTHON not found in PATH - build 3.8 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alpine-python.