2017-07-29 85 views
1

我被要求將Elixir/Phoenix應用程序移到Docker,而我之前沒有經驗。該應用程序使用非最新版本的Elixir和Phoenix,所以我不得不偏離在線代碼,通常關注最新版本。這促使我寫這DockerfileDocker +舊版本的Elixir/Phoenix

# FROM bitwalker/alpine-elixir:latest 
FROM bitwalker/alpine-elixir:1.3.4 
MAINTAINER Paul Schoenfelder <[email protected]> 

# 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,如果是的話,該怎麼做?除此之外,我願意接受任何和所有的建議

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] 

回答

0

這看起來像bitwalker/alpine-elixir issue 5

當使用標記的圖像,你有時可能需要明確的升級包,已安裝的軟件包在版本建立圖像時發現。
一般情況下,只需在安裝軟件包的任何命令之前添加apk --update upgrade即可。

的確,當你比較old elixir 1.4.4-based Dockerfilelatest one,你首先會在後面看到了升級:

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

嘗試,並添加到您的Dockerfile。