kasei_sanのブログ

かせいさんのIT系のおぼえがきです。胡乱の方はnoteとtwitterへ

ruby:2.3.6-alpine3.4 に、postgresql-dev 9.6系をインストールしようとしたら conflict が発生した話

現象

alpine3.4 だと、postgresql-dev や client が 9.5 系

9.6 系を入れたくて、Dockerfileで /etc/apk/repositories を加工して、alpine3.5系のパッケージを入れるように変更した

/etc/apk/repositories

  http://dl-cdn.alpinelinux.org/alpine/v3.5/main
  http://dl-cdn.alpinelinux.org/alpine/v3.5/community

するとこんなエラーが

ERROR: unsatisfiable constraints:
  openssl-dev-1.0.2n-r0:
    conflicts: 
               libressl-dev-2.5.5-r0[pc:libcrypto=1.0.2n]
               libressl-dev-2.5.5-r0[pc:libssl=1.0.2n]
               libressl-dev-2.5.5-r0[pc:openssl=1.0.2n]
    satisfies: .ruby-rundeps-0[openssl-dev]
  libressl-dev-2.5.5-r0:
    conflicts: 
               openssl-dev-1.0.2n-r0[pc:libcrypto=2.5.5]
               openssl-dev-1.0.2n-r0[pc:libssl=2.5.5]
               openssl-dev-1.0.2n-r0[pc:openssl=2.5.5]
    satisfies: 
               postgresql-dev-9.6.8-r0[libressl-dev]
  build-dependencies-0:
    masked in: cache
    satisfies: world[build-dependencies]

ruby は OpenSSL を postgresql-dev は LibreSSL を使っているため、 複数のSSLLibraryが混在してconflictが発生している様子

原因

alpine linux が 3.5 になった時に、OpenSSL から LibreSSL に切り替わったのが原因 そのため、alpine3.4系に、3.5系のSSLを使うライブラリを入れるとConflictが発生する

alpinelinux.org

日本語の記事

gihyo.jp

対策

諦めた