These are chat archives for creationix/nvm

12th
Mar 2015
Jordan Harband
@ljharb
Mar 12 2015 04:32
kriswill: nice
Kris Williams
@kriswill
Mar 12 2015 05:53
ok, so now I’m trying to do the same thing using progrium/busybox
but, it comes with ash as it’s default shell
whenever I try to opkg-install bash I get an error
something in the install.sh doesn’t work with ash, not sure what it is yet
FROM progrium/busybox

MAINTAINER Kris Williams <kris@kris.net>

ENV NODE_VERSION iojs

RUN opkg-install ca-certificates curl git libstdcpp && \
    rm -f /lib/libpthread.so.0 && \
    ln -s /lib/libpthread-2.18.so /lib/libpthread.so.0

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 | ash
what I have so far
@ljharb ever heard of ash?
anyways, I think we can get a super tiny image with this as the base
 curl https://raw.githubusercontent.com/creationix/nvm/$NVM_VERSION/install.sh | ash] 
returned a non-zero code: 1
Jordan Harband
@ljharb
Mar 12 2015 05:57
um, wat
nvm definitely is only tested on bash/sh/dash/zsh/ksh
what's "ash"
so, nvm itself should work on that, but the install script only works on bash
Kris Williams
@kriswill
Mar 12 2015 05:58
ah ok
maybe I’ll try just doing a git pull
Kris Williams
@kriswill
Mar 12 2015 07:37
@ljharb so, busybox’s git cannot do https, so I ended up doing:
FROM progrium/busybox:latest

MAINTAINER Kris Williams <kris@kris.net>

ENV NODE_VERSION iojs

RUN opkg-install \
      openssl-util \
      curl \
      git \
      bash \
      libstdcpp

RUN git clone git://github.com/creationix/nvm.git ~/.nvm
RUN echo 'test -s ~/.nvm/nvm.sh && . $_' >> ~/.bashrc
the current problem I’m having is:
```sh
Jordan Harband
@ljharb
Mar 12 2015 07:39
wait what, it can't do https?!
that's insane
Kris Williams
@kriswill
Mar 12 2015 07:39
bash-4.3# nvm ls-remote
            N/A
bash-4.3# nvm --version
0.24.0
it can do https, just not with git
Jordan Harband
@ljharb
Mar 12 2015 07:39
ah
if nvm ls-remote returns N/A tho it's likely an SSL error.
due to heartbleed and everything, your system must have fully updated certificate authorities
Kris Williams
@kriswill
Mar 12 2015 07:39
oh right
Jordan Harband
@ljharb
Mar 12 2015 07:40
also git/curl/etc need to be fully updated.
tons of security vulnerabilities otherwise.
Kris Williams
@kriswill
Mar 12 2015 07:40
checking
ok, got past that point
tar: invalid option -- 'z'
BusyBox v1.22.1 (2014-05-23 01:24:27 UTC) multi-call binary.
here’s current Dockerfile:
FROM progrium/busybox:latest

MAINTAINER Kris Williams <kris@kris.net>

ENV NODE_VERSION iojs

RUN opkg-install \
      openssl-util \
      ca-certificates \
      curl \
      git \
      bash \
      libstdcpp

RUN git clone git://github.com/creationix/nvm.git ~/.nvm
RUN echo 'test -s ~/.nvm/nvm.sh && . $_' >> ~/.bashrc
to build:
Jordan Harband
@ljharb
Mar 12 2015 07:42
"z" is an invalid option? O.o
Kris Williams
@kriswill
Mar 12 2015 07:42
kris git[master+?] ~/src/oss/docker-sails/nvm-iojs-tiny 
→ docker build --rm=true -t nvm-tiny .
Jordan Harband
@ljharb
Mar 12 2015 07:43
if this env is this old, you're going to have trouble installing node on it too :-/
Kris Williams
@kriswill
Mar 12 2015 07:43
that sets up a docker image called nvm-tiny on my machine
Jordan Harband
@ljharb
Mar 12 2015 07:43
i'd test nvm install 0.6 and up, and also nvm install -s, just in case
Kris Williams
@kriswill
Mar 12 2015 07:43
→ docker run -it --rm nvm-tiny bash
then:
yeah it’s one thing at a time
busybox is a very minimal setup
many of the tools that come with standard linux have been feature reduced, to make them super small
this image is only 13MB so far
right now that smallest debian:wheezy I can make is 309MB
what I’m trying for is like a micro sized docker image
for running iojs, and one that can support native modules
Kris Williams
@kriswill
Mar 12 2015 07:50
hmm looks like they added z option to newest busybox compression options
but it’s not in this version of the base image
Kris Williams
@kriswill
Mar 12 2015 08:27
curl -s https://{node-or-iojs}.tar.gz | gunzip | tar -xf - -C /