These are chat archives for creationix/nvm

13th
Mar 2015
Kris Williams
@kriswill
Mar 13 2015 06:45
@ljharb ok, so after messing around with busybox I found a new docker base called Alpine Linux, that has more modern packages
FROM gliderlabs/alpine:3.1

RUN apk-install \
      ca-certificates \
      bash \
      bzip2 \
      curl \
      git \
      python \
      build-base

ENV NODE_VERSION iojs

RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \
    touch ~/.bashrc

RUN NVM_VERSION="$(curl -s -L http://latest.nvm.sh -o /dev/null -D - | grep -Ei '^Location: .*tag/v[0-9.]+' | grep -oEi 'v[0-9.]+')" && \
    echo $NVM_VERSION && \
    curl https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION/install.sh | sh && \
    # # install nodefile
    source ~/.nvm/nvm.sh && \
    nvm version
the problem is when I try to nvm install iojs now it has this complaint:
bash-4.3# nvm install iojs
######################################################################## 100.0%
WARNING: checksums are currently disabled for io.js
unrecognized option `--strip-components'
BusyBox v1.22.1 (2014-11-22 09:00:22 GMT) multi-call binary.

Usage: tar -[cxtZzJjahmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]…
Kris Williams
@kriswill
Mar 13 2015 06:51
ok, I installed a non-busybox tar and it was able to handle the script
Jordan Harband
@ljharb
Mar 13 2015 06:51
nice
strip-components is a tar option too
Kris Williams
@kriswill
Mar 13 2015 06:52
Now using io.js v1.5.1
bash-4.3# iojs -p process.versions
bash: /root/.nvm/versions/io.js/v1.5.1/bin/iojs: No such file or directory
Jordan Harband
@ljharb
Mar 13 2015 06:54
which node and which iojs?
Kris Williams
@kriswill
Mar 13 2015 06:55
yeah not showing up
until I nvm use
but after nvm use ->
bash-4.3# node
bash: /root/.nvm/versions/io.js/v1.5.1/bin/node: No such file or directory
Jordan Harband
@ljharb
Mar 13 2015 06:57
you're not manually setting the PATH anywhere, right?
tbh it seems like the install failed.
Kris Williams
@kriswill
Mar 13 2015 06:57
not in the Dockerfile
it’s much closer than it was with the other busybox fs
do you have docker installed?
Jordan Harband
@ljharb
Mar 13 2015 06:59
no, i don't use it
(no particular reason why not)
i just dev on os x directly
Kris Williams
@kriswill
Mar 13 2015 06:59
I understand
yeah, docker uses boot2docker to run in a busybox vm in virtualbox
the nice thing about it is, you can test microservices easily
and the fancy thing about it, is that you can easily push code to your containers out in production
It could be handy for NVM shell development too
Jordan Harband
@ljharb
Mar 13 2015 07:02
true
Kris Williams
@kriswill
Mar 13 2015 07:02
since you can try out any configuration you want, and it just bakes them
Kris Williams
@kriswill
Mar 13 2015 07:21
hmm, yeah it’s not want to run iojs
bash-4.3# nvm run iojs -p process.versions
Running io.js v1.5.1
bash: /root/.nvm/versions/io.js/v1.5.1/bin/iojs: No such file or directory
bash-4.3# ls -la /root/.nvm/versions/io.js/v1.5.1/bin/iojs
-rwxrwxr-x    1 500      500       16545561 Mar  9 18:14 /root/.nvm/versions/io.js/v1.5.1/bin/iojs
Kris Williams
@kriswill
Mar 13 2015 07:27
here’s my current Dockerfile if you want to play around with it:
FROM mini/base

RUN apk-install \
      bash \
      tar \
      curl \
      git \
      c-ares \
      libgcc \
      libstdc++ \
      libuv

RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \
    touch ~/.bashrc

ENV NODE_VERSION iojs

RUN NVM_VERSION="$(curl -s -L http://latest.nvm.sh -o /dev/null -D - | grep -Ei '^Location: .*tag/v[0-9.]+' | grep -oEi 'v[0-9.]+')" && \
    echo $NVM_VERSION && \
    curl https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION/install.sh | sh && \
    source ~/.nvm/nvm.sh && \
    nvm install $NODE_VERSION
to build it:
→ docker build --rm=true -t nvm-tiny .
to run:
→ docker run --rm -it nvm-tiny bash
Kris Williams
@kriswill
Mar 13 2015 19:47
mini-containers/base#5