docToolchain / docker-image

MIT License
2 stars 18 forks source link

Custom repository or proxy requried #24

Closed faltfe closed 2 years ago

faltfe commented 2 years ago

We want to use the new dtcw using the docker image. The docker image is downloaded und started just fine but the dependencies can't be resolved. This happens to due to a restricted internet access in our CI environment. There are a few possibilities I can think of

  1. Provide a proxy configuration inside the docker container which is managed as a volumn or environment variables
  2. We could create a custom child image which provide the proxy settings.
  3. Provide a custom repository setting where the dependencies are downloaded from
  4. Provide all dependencies with this docker image (#15)

The main issue is https://github.com/docToolchain/docker-image/blob/147cf90213f9c6a1a261bd6def1aeb1165f6128e/alpine/Dockerfile#L43 I guess.

rdmueller commented 2 years ago

with the line

https://github.com/docToolchain/docker-image/blob/147cf90213f9c6a1a261bd6def1aeb1165f6128e/alpine/Dockerfile#L43

I tried to download all dependencies into the image at build time, but didn't succeed.

If you just need a proxy configuration, remember that dtcw is a wrapper around gradle. So instead of calling

./dtcw generateSite

you could call

./dtcw generateSite -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 "-http.nonProxyHosts=*.nonproxyrepos.com|localhost"

(IP, port, etc just an example)

see also https://stackoverflow.com/questions/5991194/gradle-proxy-configuration

faltfe commented 2 years ago

Thanks for the fast response. I didn't know that dtcw will even pass command line arguments to the docker image. This is pretty fancy staff I have to figure out later 👍

Passing the proxy settings as command line arguments solves my problem. But I would recommend to mention how to use a proxy inside the documentation to prevent further questions.

rdmueller commented 2 years ago

But I would recommend to mention how to use a proxy inside the documentation to prevent further questions.

yes, that is a good idea. Unfortunaltly, I miss the time and a proxy to test. Would be great if you could write down your experience...