Skip to content

Publish Yarn to the Alpine Linux package repository (APK) #1326

@ide

Description

@ide

This is a feature request to publish Yarn to Alpine Linux's package repository. The primary motivation is to be able to more easily use Yarn when building Docker images built on top of Alpine Linux. (Alpine is a distro that's much lighter than Ubuntu and earlier this year there was some discussion that Docker was moving its official images to Alpine: https://www.brianchristner.io/docker-is-moving-to-alpine-linux/.)

Feb 2017 Edit: Following the discussion below, if you are running Alpine in a Docker image that already includes Node (ex: mhart/alpine-node:base-7), you might want to install Yarn by copying the files directly:

ENV YARN_VERSION 0.20.0
ADD https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v${YARN_VERSION}.tar.gz /opt/yarn.tar.gz
RUN yarnDirectory=/opt/yarn && \
    mkdir -p "$yarnDirectory" && \
    tar -xzf /opt/yarn.tar.gz -C "$yarnDirectory" && \
    ln -s "$yarnDirectory/dist/bin/yarn" /usr/local/bin/ && \
    rm /opt/yarn.tar.gz

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions