dnephin / dobi

A build automation tool for Docker applications
https://dnephin.github.io/dobi/
Apache License 2.0
311 stars 36 forks source link

Proxy setting from~/.docker/config.json ignored #193

Open sbrt opened 4 years ago

sbrt commented 4 years ago

Running the example under dobi/examples/project-setup with dobi app on a host that is behind a proxy server, docker fails during fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz. When building with docker build ., the docker builds using my proxy settings from ~/.docker/config.json

When I set the HTTP_PROXY environmental variable in the Dockerfile like so....

FROM    alpine:3.4
ENV HTTP_PROXY "<proxy>"
RUN     apk -U add bash
COPY    setup.sh /usr/bin/setup.sh
WORKDIR /code
CMD     ["/usr/bin/setup.sh"]

... and run again dobi app, everything works.

Hence, dobi ignores the docker proxy settings in ~/.docker/config.json.

This impacts portability a bit, if all Dockerfiles have to be modified with proxy settings.

Other than that, thanks a lot for the great tool :-)

dnephin commented 4 years ago

Thank you for the report! I think this sounds related to #189 in some ways.

I believe because the go-dockerclient version that is being used is so old it doesn't know about the ~/.docker/config.json. It's still expecting the old path ~/.dockercfg. I'm not sure if it supports proxy settings either.

Updating the dockerclient or changing to use the official docker one may fix the problem.