Volta: Provide statically-linked musl binary for Alpine Linux

Created on 13 Jun 2019  路  7Comments  路  Source: volta-cli/volta

I tried adding volta to a container and when I try to execute it, I get:

bash: /root/.volta/volta: No such file or directory

Here is the Dockerfile I'm using:

FROM alpine:3.9

RUN apk update
RUN apk add bash
RUN apk add openssl
RUN apk add curl
RUN apk add git

RUN touch ~/.bash_profile
RUN curl -sSLf https://get.volta.sh | bash

CMD [ "/bin/bash" ]
enhancement error messages

Most helpful comment

This would be a great feature for docker based CI and development environments since alpine based containers are extremely slim. Would appreciate if someone look into this or/and if we get an official image on docker hub just like official github actions.

All 7 comments

Hi @BryanHunt, thanks for reporting this! I'll admit to not having experience with Docker (though I'm going to look into it a bit since this Dockerfile seems straightforward enough). This is a strange one, as the error seems to indicate that the installer worked and correctly modified the profile, but that that it failed to install the files (which it would do first, and so if that failed the rest shouldn't have happened).

Can you show the contents of /root/.bash_profile, as well as the contents of /root/.volta (if it exists) in the container? Also, is there a log from the startup that would show the output of the Volta installer? Thanks!

I think the issue is that there are some shared system libraries missing and the error message is misleading.

Thanks for the follow-up @BryanHunt. That would definitely be misleading if the root cause was an inability to find shared libraries. While we can鈥檛 do much to fix bash having bad errors, with some investigation, we may be able to better document the required libraries.

@BryanHunt I dug in a bit with that Dockerfile, and you're right, there are a number of shared libraries that aren't available with that setup of Alpine. The biggest issue is that the current builds of Volta are all dynamically linked to glibc, while Alpine is built using musl libc.

We have talked in the past about doing some static linking in Volta (when we were looking at OpenSSL compatibility issues), but we ultimately decided against it for a number of reasons. We could discuss the idea of providing a fully statically-linked version as an advanced option, with the disclaimers that the end-user is responsible for keeping it up-to-date as that version won't be getting security updates from the shared libraries on the system.

Tracking in the Updates / Notifications project, as if we make a statically-linked binary, we should absolutely have a path for upgrading and notifying users that a new version is available.

This would be a great feature for docker based CI and development environments since alpine based containers are extremely slim. Would appreciate if someone look into this or/and if we get an official image on docker hub just like official github actions.

I'd really appreciate a way to run volta on an alpine docker image as well!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ef4 picture ef4  路  5Comments

rwjblue picture rwjblue  路  3Comments

jhford picture jhford  路  6Comments

felipecrs picture felipecrs  路  5Comments

chriskrycho picture chriskrycho  路  4Comments