【问题标题】:Docker + older version of Elixir/PhoenixDocker + 旧版本的 Elixir/Phoenix
【发布时间】:2017-07-29 07:05:09
【问题描述】:

有人要求我将 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,如果是,该怎么做?除此之外,我愿意接受任何和所有建议

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]

【问题讨论】:

    标签: docker elixir phoenix-framework alpine musl


    【解决方案1】:

    看起来像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。

    【讨论】:

      猜你喜欢
      • 2014-11-01
      • 1970-01-01
      • 2020-03-07
      • 2016-10-22
      • 2018-05-22
      • 2018-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多