Docker build表示无法满足的约束

时间:2018-07-23 01:47:37

标签: ruby-on-rails docker docker-compose

我正在尝试设置一个可以运行使用ruby 1.8.7的旧版Rails 2.3应用程序的docker映像。

我找到了这个dockerfile,当我尝试运行它时,出现以下错误:

  

获取   http://alpine.gliderlabs.com/alpine/v3.6/main/x86_64/APKINDEX.tar.gz   取   http://alpine.gliderlabs.com/alpine/v3.6/community/x86_64/APKINDEX.tar.gz   错误:约束无法满足:ruby-rmagick(丢失):       所需者:world [ruby-rmagick] libressl-dev-2.5.5-r2:       冲突:                  openssl-dev-1.0.2o-r1 [pc:libcrypto = 2.5.5]                  openssl-dev-1.0.2o-r1 [pc:libssl = 2.5.5]                  openssl-dev-1.0.2o-r1 [pc:openssl = 2.5.5]       满足:                  mariadb-dev-10.1.32-r0 [libressl-dev] openssl-dev-1.0.2o-r1:       冲突:                  libressl-dev-2.5.5-r2 [pc:libcrypto = 1.0.2o]                  libressl-dev-2.5.5-r2 [pc:libssl = 1.0.2o]                  libressl-dev-2.5.5-r2 [pc:openssl = 1.0.2o]       满足:world [openssl-dev]错误:服务“ rails”构建失败:命令“ / bin / sh -c apk更新&& apk升级&&
  apk --no-cache添加tzdata $ BUILD_PACKAGES $ GEM_PACKAGES && cp   / usr / share / zoneinfo / Asia / Tokyo / etc / localtime && apk del tzdata'   返回了非零代码:4

Dockerfile如下:

FROM gliderlabs/alpine:latest

ENV BUILD_PACKAGES bash wget curl tar make gcc alpine-sdk zlib zlib-dev readline 
ENV GEM_PACKAGES openssl openssl-dev libxml2-dev libxslt-dev mysql mariadb-dev imagemagick imagemagick-dev imagemagick-c++ ruby-rmagick

RUN apk update && \
    apk upgrade && \
    apk --no-cache add tzdata \
    $BUILD_PACKAGES $GEM_PACKAGES && \
  cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \
  apk del tzdata 

# build ruby
RUN wget -q -O ruby-1.8.7-p374.tar.gz http://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.gz && \
    tar -zxvf ruby-1.8.7-p374.tar.gz && \
    rm ruby-1.8.7-p374.tar.gz

WORKDIR ruby-1.8.7-p374
RUN ./configure --with-openssl-dir=/usr/bin
RUN make
RUN make install

# install rubygems
WORKDIR /
RUN wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz && \
    tar -zxvf rubygems-1.3.7.tgz && \
    rm rubygems-1.3.7.tgz
WORKDIR rubygems-1.3.7
RUN ruby setup.rb

# install bundler
RUN gem install bundler

WORKDIR /app
COPY Gemfile /app/

# bundle install
RUN bundle install
COPY . /home/app

0 个答案:

没有答案