gliderlabs / gliderlabs/docker-alpine
Proxy authentication with HTTP_PROXY_AUTH?
- Dominant language
- Shell
- Stars
- 5.7k
- Forks
- 530
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thanks for the great docker images. I am hoping to get some help with a proxy problem, or some direction. Here is the message I am getting.:
UPDATE/EDIT: It looks like this is reproducible only if I have a bang (!) in my password. I tried encoded (%21) and just the character (!) and both fail out with the same error below when in HTTP_PROXY.
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz: Permission denied
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz: Permission denied
This seems to have started this week on some docker containers we use for PHP development (based on alpine). We are behind a proxy that requires authentication. We have been using the http_proxy environment variables with our user name and password inline. This is set when we build the images (`docker build --build-arg HTTPS_PROXY=$$HTTP_PROXY`). i.e.:
`HTTP_PROXY=http://user:pass@proxyserver:port`
`HTTPS_PROXY=http://user:pass@proxyserver:port`
`http_proxy=http://user:pass@proxyserver:port`
`https_proxy=http://user:pass@proxyserver:port`
This has worked for the last couple months without issues. However, now it seems we need to use HTTP_PROXY_AUTH ? I noticed this in : https://github.com/gliderlabs/docker-alpine/issues/191#issuecomment-246944011
Here is an excerpt of our Dockerfile where it is failing (specifically on `docker-php-ext-install xdebug` as it needs to `apk add`).:
# Xdebug.
RUN git clone https://github.com/xdebug/xdebug.git /tmp/xdebug \
&& mkdir -p /usr/src/php/ext \
&& mv /tmp/xdebug /usr/src/php/ext/ \
&& docker-php-ext-install xdebug
To work around this I changed the code to:
# Xdebug.
RUN git clone https://github.com/xdebug/xdebug.git /tmp/xdebug
RUN mkdir -p /usr/src/php/ext
RUN mv /tmp/xdebug /usr/src/php/ext/
ENV HTTP_PROXY=http://proxy:port
ENV HTTP_PROXY_AUTH=basic:*:user:pass
RUN docker-php-ext-install xdebug
If I do this for https the clone fails with message:
Cloning into '/tmp/xdebug'...
fatal: unable to access 'https://github.com/xdebug/xdebug.git/': Received HTTP code 407 from proxy after CONNECT
ERROR: Service 'web' failed to build: The command '/bin/sh -c git clone https://github.com/xdebug/xdebug.git /tmp/xdebug && mkdir -p /usr/src/php/ext && mv /tmp/xdebug /usr/src/php/ext/ && docker-php-ext-install xdebug' returned a non-zero code: 128
In troubleshooting I was also able to use curl and wget without setting HTTP_PROXY_AUTH...
Looking at the man for libfetch I think this maybe an issue there? Maybe this was updated recently in alpine?
HTTP_PROXY_AUTH
Specifies authorization parameters for the HTTP proxy in the sameformat as the HTTP_AUTHvariable.
This variable is used if and only if connected to an HTTP proxy, andis ignored if a user and/or a password were specified in the proxyURL.
http://rpm.pbone.net/index.php3/stat/45/idpl/33638817/numer/3/nazwa/fetch
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.