Open3

alpine

techno.kokitechno.koki

シェルはash
bashではないので注意
シェルスクリプト冒頭のshebangは「#!/bin/sh」と記載する必要があるので、そこも注意

techno.kokitechno.koki

元々yarnはインストールされているので、
Dockerfile内でyarnをインストールしようとするとエラーになる

> npm i -g yarn && yarn

> yarn@1.22.10 preinstall /usr/local/lib/node_modules/yarn
> :; (node ./preinstall.js > /dev/null 2>&1 || true)

npm ERR! code EEXIST
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/yarn/bin/yarn.js
npm ERR! dest /usr/local/bin/yarn
npm ERR! errno -17
npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/yarn/bin/yarn.js' -> '/usr/local/bin/yarn'
npm ERR! File exists: /usr/local/bin/yarn
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

https://odaryo.hatenablog.com/entry/2020/01/08/211618