简体   繁体   English

Docker +旧版本的Elixir / Phoenix

[英]Docker + older version of Elixir/Phoenix

I have been requested to move an Elixir/Phoenix app to Docker, with which I have no prior experience. 我被要求将Elixir / Phoenix应用程序移至Docker,而我以前没有这方面的经验。 The app uses non-latest versions of Elixir and Phoenix so I have had to diverge from the code online which generally focuses on latest versions. 该应用程序使用非最新版本的Elixir和Phoenix,因此我不得不偏离在线代码,后者通常侧重于最新版本。 That led me to write this Dockerfile 那导致我写了这个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>

On running 跑步时

sudo docker build -t phoenix .

I'm ending up with this error and wondering how to get around it? 我最终遇到此错误,想知道如何解决它? Noting 'current' in the title I'm wondering whether using an older version of nodejs, and if so, how to do that? 注意标题中的“ current”,我想知道是否使用旧版本的nodejs,如果使用的话,该怎么做? Beyond that I am open to any and all suggestions 除此之外,我愿意接受所有建议

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]

That looks like bitwalker/alpine-elixir issue 5 : 看起来像bitwalker / alpine-elixir问题5

when using tagged images, you may sometimes need to explicitly upgrade packages, as the installed packages are at the versions found when building the image. 使用带标签的映像时,有时可能需要显式升级软件包,因为安装的软件包是在生成映像时找到的版本。
Generally it's as simple as adding apk --update upgrade before any commands which install packages. 通常,这就像在安装软件包的任何命令之前添加apk --update upgrade一样简单。

Indeed, when you compare the old elixir 1.4.4-based Dockerfile , and the latest one , you will see an upgrade first in the latter: 确实,当您比较旧的基于elixir 1.4.4的Dockerfile最新 的Dockerfile时 ,您将在后者中首先看到一个升级:

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

Try and add that to your Dockerfile. 尝试将其添加到您的Dockerfile中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Elixir在phoenix代码重新加载器打开的情况下在docker中请求变慢 - Elixir requests slow in docker with phoenix code reloader on 如何在 Heroku 上创建/迁移 Elixir Phoenix Docker 镜像? - How to create/migrate Elixir Phoenix Docker image on Heroku? 在Docker中使用Erlang Observer App和远程Elixir Phoenix服务器 - Using the Erlang Observer App with a remote Elixir Phoenix server inside Docker 无法从Docker中的elixir / phoenix连接到SQL Server - Can't connect to SQL Server from elixir/phoenix in Docker 使用Docker安装旧版本的MongoDB - Install older version of MongoDB with Docker yum 安装旧版本的 docker - yum install older version docker 在 docker 上安装旧版本的作曲家 - Install older version of composer on docker 如何使用 Phoenix Guides 中的示例在生产模式下运行 Elixir Phoenix Docker? - How do I run Elixir Phoenix Docker in production mode using example from Phoenix Guides? 如何使用 elixir phoenix 版本和指南中的示例 MyApp.Release.rollback 在 docker 容器中回滚数据库 - How to rollback database in docker container using elixir phoenix releases and the example MyApp.Release.rollback in the guides 无法从 Phoenix Elixir App 到达 RabbitMQ broker 到 RabbitMQ Container Docker - Unable to reach RabbitMQ broker from Phoenix Elixir App to RabbitMQ Container Docker
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM