Giter Site home page Giter Site logo

Comments (8)

jfloff avatar jfloff commented on August 27, 2024 16

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.

Multihuntr avatar Multihuntr commented on August 27, 2024 8

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.

javixeneize avatar javixeneize commented on August 27, 2024 4

from alpine-python.

gbarco avatar gbarco commented on August 27, 2024 4

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.

jfloff avatar jfloff commented on August 27, 2024

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.

jfloff avatar jfloff commented on August 27, 2024

Were you able to reach a solution @javixeneize ?

from alpine-python.

javixeneize avatar javixeneize commented on August 27, 2024

Hi. Sorry, yes, it works fine configuring the proxy inside

Thanks

from alpine-python.

jfloff avatar jfloff commented on August 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.