Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wget installation does not work on Alpine #73

Closed
goloroden opened this issue May 1, 2016 · 8 comments
Closed

wget installation does not work on Alpine #73

goloroden opened this issue May 1, 2016 · 8 comments

Comments

@goloroden
Copy link

goloroden commented May 1, 2016

Steps to reproduce

$ docker run -it mhart/alpine-node:6 sh
# wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.0.1/dumb-init_1.0.1_amd64

Expected result

dumb-init is installed, as it happens when using the ubuntu container, e.g..

Actual result

An error message is returned by wget:

Connecting to github.com (192.30.252.120:443)
wget: can't execute 'ssl_helper': No such file or directory
wget: error getting response: Connection reset by peer

Any thoughts on this?

@goloroden
Copy link
Author

Okay, forget it … it was a problem with the CA certificates on Alpine Linux. You need to run

# apk update
# apk add ca-certificates
# update-ca-certificates

before running wget, then it works :-)

@mikecroft
Copy link

mikecroft commented Aug 17, 2016

FYI for others coming across this, adding the above commands to my Dockerfile did not work, I needed to specifically add the ca-certificates to wget like this:

 RUN   apk update \                                                                                                                                                                                                                        
  &&   apk add ca-certificates wget \                                                                                                                                                                                                      
  &&   update-ca-certificates    

that worked perfectly and my image built with no problems.

@tvalasek
Copy link

openssl package may be required too:

apk update && apk add ca-certificates && update-ca-certificates && apk add openssl

@asottile
Copy link
Contributor

How difficult would it be to make an apk package for dumb-init? We're experienced in debian packaging but unfamiliar with alpine's ecosystem and would love help if it's possible

@igorsantos07
Copy link

For those who arrive here, another solution is simply to use curl instead, if your idea is to run install scripts. It sounds even simpler, with less options to deal with - the default is to send to stdin for instance.

Example: to install composer on php:7-fpm-alpine I did the following:
RUN curl https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer | php -- --quiet

instead of what's suggested by Composer (that stumbles upon the CA issues on this post):
RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer -O - -q | php -- --quiet

@vinyll
Copy link

vinyll commented Sep 21, 2016

I had

wget: can't execute 'ssl_helper': No such file or directory
wget: error getting response: Connection reset by peer

apk add openssl solved in my case

@samrocketman
Copy link

I frown upon curl | bash installation instructions (curl | php is no different). I hope dumb-init never adopts such insecure recommendations as instructions. It grooms users with poor behaviors.

@dhoer
Copy link

dhoer commented Oct 7, 2016

As of Alpine Linux 3.3 there exists a new --no-cache option for apk. It allows users to install packages with an index that is updated and used on-the-fly and not cached locally:

RUN apk --no-cache add openssl


Update on this;

While that fixed it for https protocol, it caused issues for http protocol. Reinstalling wget on alpine fixed wget: error getting response: Invalid argument error:

RUN apk --no-cache add openssl wget

alexbepple added a commit to it-agile/financial-radar that referenced this issue Feb 5, 2017
explanation for the line
	RUN apk --no-cache add openssl
Yelp/dumb-init#73
bbarker added a commit to bbarker/nix that referenced this issue Sep 1, 2017
See Yelp/dumb-init#73 for more discussion and alternatives
cheezenaan added a commit to cheezenaan-sandbox/sample_app_rev4 that referenced this issue May 30, 2018
* to avoid failure executing wget
* ref. Yelp/dumb-init#73
matentzn added a commit to INCATools/ontology-development-kit that referenced this issue May 15, 2019
Previously, it occassionally happened (EBI cluster, PHIPO vagrant server) that wget failed with a (connection reset by peer) error, see Yelp/dumb-init#73.

The problem is solved by re-installing openssl and wget.
chusiang added a commit to chusiang/ansible.dockerfile that referenced this issue Dec 9, 2019
Refactor the "Update CA certificates flow" part for fixed "wget: error getting response: Connection reset by peer" problem.

Problem:

```
wget -q -O- https://example.tw | bash | tee test.yml
wget: error getting response: Connection reset by peer
```

Reference:

* wget installation does not work on Alpine · Issue #73 · Yelp/dumb-init - Yelp/dumb-init#73
* Alpine Linux 出現 wget: error getting response: Connection reset by peer 解決辦法 | 刺客博客 - https://cikeblog.com/alpine-linux-wget-error-getting-response-connection-reset-by-pee.html
mattburgess added a commit to dwp/docker-awscli that referenced this issue Oct 28, 2020
`wget` doesn't work on Alpine when making a request via an HTTPS
proxy. See Yelp/dumb-init#73 but the
workarounds there don't work either.
mattburgess added a commit to dwp/docker-awscli that referenced this issue Oct 28, 2020
`wget` doesn't work on Alpine when making a request via an HTTPS
proxy. See Yelp/dumb-init#73 but the
workarounds there don't work either.
tpai added a commit to tpai/web-scraper that referenced this issue Jul 29, 2021
wget: error getting response: invalid argument
Yelp/dumb-init#73 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants