Docker + Elixir / Phoenix的旧版本

我被要求将一个Elixir / Phoenix应用程序移动到Docker,而我没有以前的经验。 该应用程序使用非最新版本的Elixir和Phoenix,所以我不得不偏离在线代码,通常关注最新版本。 这导致我写这个Dockerfile

# FROM bitwalker/alpine-elixir:latest FROM bitwalker/alpine-elixir:1.3.4 MAINTAINER Paul Schoenfelder <paulschoenfelder@gmail.com> # Important! Update this no-op ENV variable when this Dockerfile # is updated with the current date. It will force refresh of all # of the base images and things like `apt-get update` won't be using # old cached versions when the Dockerfile is built. ENV REFRESHED_AT=2017-07-26 \ # Set this so that CTRL+G works properly TERM=xterm # Install NPM RUN \ mkdir -p /opt/app && \ chmod -R 777 /opt/app && \ apk update && \ apk --no-cache --update add \ git make g++ wget curl inotify-tools \ nodejs nodejs-current-npm && \ npm install npm -g --no-progress && \ update-ca-certificates --fresh && \ rm -rf /var/cache/apk/* # Add local node module binaries to PATH ENV PATH=./node_modules/.bin:$PATH \ HOME=/opt/app # Install Hex+Rebar RUN mix local.hex --force && \ mix local.rebar --force WORKDIR /opt/app CMD ["/bin/sh"] <then it goes on to add some elixir depedencies> 

在跑步

 sudo docker build -t phoenix . 

我结束了这个错误,想知道如何解决它? 注意标题中的“当前”我想知道是否使用旧版本的nodejs,如果是的话,该怎么做? 除此之外,我愿意接受任何build议

 ERROR: unsatisfiable constraints: nodejs-current-npm (missing): required by: world[nodejs-current-npm] musl-1.1.14-r14: breaks: musl-dev-1.1.14-r15[musl=1.1.14-r15] 

这看起来像是一个bitwalker / alpine-elixir问题5 :

在使用标记图像时,有时可能需要显式升级包,因为安装的包位于构build映像时发现的版本中。
一般来说,就像在任何安装软件包的命令之前添加apk --update upgrade一样简单。

事实上,当你比较旧的基于elixir 1.4.4的Dockerfile和最新 的Dockerfile时 ,你会看到后者的升级:

 apk --no-cache --update upgrade && \ apk add --no-cache --update --virtual .elixir-build \ ... 

尝试并将其添加到您的Dockerfile。