gpt4 book ai didi

Docker + 旧版本的 Elixir/Phoenix

转载 作者:行者123 更新时间:2023-12-02 18:40:00 25 4
gpt4 key购买 nike

我被要求将 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]

最佳答案

看起来像 bitwalker/alpine-elixir issue 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.



事实上,当您比较 old elixir 1.4.4-based Dockerfile ,以及 latest one ,您将在后者中首先看到升级:
apk --no-cache --update upgrade && \
apk add --no-cache --update --virtual .elixir-build \
...

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

关于Docker + 旧版本的 Elixir/Phoenix,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45386417/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com