Skip to content

Instantly share code, notes, and snippets.

@tony612
Last active November 22, 2017 12:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tony612/126a4d9bc1bf4332bc463f2cfc5aa468 to your computer and use it in GitHub Desktop.
Save tony612/126a4d9bc1bf4332bc463f2cfc5aa468 to your computer and use it in GitHub Desktop.
The right way to use Elixir+Docker in China
# git clone https://github.com/hexpm/hex.git
# cd hex
# git checkout v0.15.0
# # Add this Dockerfile in the dir
# docker build .
# # Then you can use the image as your base image to speedup your usage
FROM elixir:1.5.2
RUN HEX_MIRROR=https://hexpm.upyun.com mix local.rebar --force \
# rebar3 update should be rerun if you add a new rebar dependence
# or upgrade one, which is a little inconvenient
&& ~/.mix/rebar3 update
COPY . /tmp/hex
RUN cd /tmp/hex \
&& mix install \
&& cd \
&& rm -r /tmp/hex
RUN mix hex.config mirror_url https://hexpm.upyun.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment