Skip to content

Instantly share code, notes, and snippets.

@rubysolo
Created January 23, 2018 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubysolo/c78f55690b9cf2ff015b6ec049cfe07f to your computer and use it in GitHub Desktop.
Save rubysolo/c78f55690b9cf2ff015b6ec049cfe07f to your computer and use it in GitHub Desktop.
Docker mix install helper
#!/bin/sh
# manually download and "install" a given mix dep for non-elixir environment
#
# for example, download phoenix in a frontend build stage to get JS deps
depname=$1
version=$(grep "\"$depname\"" mix.lock | cut -d, -f 3 | sed -e 's/ *"//g')
echo "installing $depname version $version..."
mkdir -p deps
cd deps
wget https://s3.amazonaws.com/s3.hex.pm/tarballs/$depname-$version.tar
mkdir $depname
tar xf $depname-*.tar -C $depname
cd $depname
tar zxf contents.tar.gz
echo "done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment