phase2 / docker-build

The Outrigger Build image provides a command-line toolkit for PHP & Node development with Drupal support.
http://docs.outrigger.sh/
1 stars 5 forks source link

Add NPM 5 to the build container #12

Open grayside opened 7 years ago

grayside commented 7 years ago

In order to allow easy experimenting with Yarn on projects (in the name of performance and more consistent builds) let's add it to the image.

Here's a custom Dockerfile I created to allow projects to use Yarn locally.

FROM outrigger/build:php70

RUN curl https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo && \
    yum -y install yarn && \
    yum clean all

I got these steps from https://yarnpkg.com/lang/en/docs/install/#linux-tab, where the Alternatives tab notes that they recommend against installing with npm.

In order to add this to the main build image Dockerfile, I would add the repository (in the first line) as part of or after the RUN block that adds the IUS repo. Then I would add Yarn near the bottom of the list of yum packages.

We do not currently have the yum clean all, we should add it to condense the image a bit.

febbraro commented 7 years ago

Disregard the Yarn comment above. NPM 5 is our direction.

grayside commented 6 years ago

We are currently headed in the direction of starting new projects on Node 8, therefore we only need to tailor the image to add npm v5 to Node 4 & 6 if we want facilitate existing projects upgrading.