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 fails on Alpine during Dockerfile build #5754

Closed
kairi003 opened this issue Aug 23, 2024 · 0 comments · Fixed by #5763
Closed

wget installation fails on Alpine during Dockerfile build #5754

kairi003 opened this issue Aug 23, 2024 · 0 comments · Fixed by #5763
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@kairi003
Copy link
Contributor

Description

When I ran ./run pnpm install, I encountered an issue where /root/.shrc could not be found.
Tracing the Dockerfile, I discovered that the installation of pnpm was failing because wget was failed on Alpine as reported in Yelp/dumb-init#73 .
As indicated there, adding the following line allows it to work correctly:

RUN apk --no-cache add openssl wget

Additionally, the reason I didn't notice this bug immediately is that errors in the middle of a pipe do not propagate. We should add set -o pipefail.

Steps to reproduce

$ docker run -it --rm node:20.12.2-alpine3.19 sh
/ # wget -qO- https://get.pnpm.io/install.sh
wget: error getting response: Invalid argument
/ # wget -qO- https://get.pnpm.io/install.sh
wget: error getting response: Invalid seek
/ # wget -qO- https://get.pnpm.io/install.sh
wget: error getting response: Invalid seek

Screenshots

No response

Code Sample

No response

Setup

  • Mermaid version:
  • Browser and Version: [Chrome, Edge, Firefox]

Suggested Solutions

  • Add RUN apk --no-cache add openssl wget
  • Set pipefail mode for safe
 FROM node:20.12.2-alpine3.19 AS base
-RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
+RUN apk --no-cache add openssl wget
+RUN set -o pipefail && wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -

Additional Context

No response

@kairi003 kairi003 added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
1 participant