Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Add support for local proxies #10

Open
pameck opened this issue Jun 28, 2018 · 5 comments
Open

Add support for local proxies #10

pameck opened this issue Jun 28, 2018 · 5 comments

Comments

@pameck
Copy link
Contributor

pameck commented Jun 28, 2018

Hi,
I am using cntlm to go through a proxy.
The environment variables that I have set in my host are something like this:

https_proxy=http://localhost:3333
http_proxy=http://localhost:3333
...

I have to set the variables in batect.yml to something like this:

....
   environment:
      - https_proxy=http://host.docker.internal:3333
      - http_proxy=http://host.docker.internal:3333
..

Otherwise batect.yml picks up the ones set in the environment which wouldn't work within the container.

@charleskorn
Copy link
Collaborator

Thanks for the feedback @pameck, this seems like something that batect should take care of for you.

On Mac it looks pretty straightforward: if the proxy refers to localhost or 127.0.0.1, use host.docker.internal on Docker 18.03+ or the now-deprecated docker.for.mac.localhost on Docker 17.06+.

On Linux, it's not quite that simple. docker/for-linux#264 talks about adding support for host.docker.internal to Linux hosts, but that hasn't been implemented. I'm sure there's a way to do it though, I'll do some digging.

charleskorn added a commit that referenced this issue Jul 3, 2018
@charleskorn charleskorn changed the title Add support for authentication proxy Add support for local proxies Jul 5, 2018
@charleskorn charleskorn self-assigned this Jul 5, 2018
charleskorn added a commit that referenced this issue Jul 5, 2018
This currently only supports more recent versions of Docker for Mac.

This will be required to implement #10.
charleskorn added a commit that referenced this issue Jul 6, 2018
This means that #10 is now implemented on OS X. (It is not yet
implemented for Linux hosts, as that will be far more involved.)
@charleskorn
Copy link
Collaborator

charleskorn commented Jul 6, 2018

Support for this on OS X has been added and will be included in 0.16.

Supporting this on Linux is way more involved, so I'm not going to add it right now.

Thanks again for the feedback @pameck!

@charleskorn
Copy link
Collaborator

Once moby/libnetwork#2348 is merged and released, adding support for this on Linux should be straightforward.

charleskorn pushed a commit that referenced this issue Nov 29, 2020
…manes.versions-0.36.0

Bump com.github.ben-manes.versions from 0.34.0 to 0.36.0
charleskorn added a commit that referenced this issue Dec 23, 2020
…ith an image that uses a non-default syntax.

The output previously looked something like (note output for #3 and #4):

#1 [internal] load remote build context
#1 DONE

#2 copy /context /
#2 DONE

#3 resolve image config for docker.io/docker/dockerfile:1.1-experimental
#3 ...

#4 docker-image://docker.io/docker/dockerfile:1.1-experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44
#4 ...

#5 [internal] load metadata for docker.io/library/ruby:2.7.2
#5 DONE

#6 [ 1/12] FROM docker.io/library/ruby:2.7.2
#6 DONE

#7 [ 2/12] RUN mkdir -p /tools
#7 CACHED

#8 [ 3/12] COPY health-check.sh /tools
#8 CACHED

#9 [ 4/12] RUN mkdir -p /app
#9 CACHED

#10 [ 5/12] COPY app/Gemfile app/Gemfile.lock /app/
#10 CACHED

#11 [ 6/12] WORKDIR /app
#11 CACHED

#12 [ 7/12] RUN bundle config set deployment true
#12 CACHED

#13 [ 8/12] RUN bundle config set without development
#13 CACHED

#14 [ 9/12] RUN bundle install
#14 CACHED

#15 [10/12] COPY app/config.ru /app
#15 CACHED

#16 [11/12] COPY app/bin /app/bin
#16 CACHED

#17 [12/12] COPY app/lib /app/lib
#17 ...

#3 resolve image config for docker.io/docker/dockerfile:1.1-experimental
#3 DONE

#4 docker-image://docker.io/docker/dockerfile:1.1-experimental@sha256:de85b2f3a3e8a2f7fe48e8e84a65f6fdd5cd5183afa6412fff9caa6871649c44
#4 CACHED

#17 [12/12] COPY app/lib /app/lib
#17 CACHED

#18 exporting to image
#18 exporting layers: done
#18 writing image sha256:ace2572ab366a9153b23ccc0667cc6163a32a3cbb96bfef237a25c68005699a6: done
#18 naming to docker.io/library/batect-sample-ruby-international-transfers-service: done
#18 DONE
@stale
Copy link

stale bot commented Feb 28, 2021

This issue has been automatically marked as stale because it has not had any activity in the last 60 days. It will automatically be closed if no further activity occurs in the next seven days to enable maintainers to focus on the most important issues.
If this issue is still affecting you, please comment below within the next seven days.
Thank you for your contributions.

@stale stale bot added the stale label Feb 28, 2021
@charleskorn charleskorn added the frozen Issue should not be marked as stale label Feb 28, 2021
@stale stale bot removed the stale label Feb 28, 2021
@charleskorn charleskorn added stale and removed stale labels Feb 28, 2021
@charleskorn
Copy link
Collaborator

With docker/for-linux#264 (comment), this is now unblocked for Linux 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants