首页 > 解决方案 > 无法为 docker ruby​​ alpine 安装 openssl-dev

问题描述

我的 Dockerfile

FROM ruby:2.6.3-alpine

RUN apk add --no-cache build-base tzdata postgresql-dev postgresql-client

# throw errors if Gemfile has been modified since Gemfile.lock 

RUN bundle config --global frozen 1

ENV APP_PATH /app

RUN mkdir -p $APP_PATH 
WORKDIR $APP_PATH 
COPY Gemfile $APP_PATH 
COPY Gemfile.lock $APP_PATH 
RUN bundle install 
COPY . $APP_PATH

EXPOSE 3000

CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]

我注意到安装postgresql-dev会导致安装openssl-dev

无论如何,运行docker-compose up会输出

$ docker-compose up
Building sidekiq
Step 1/12 : FROM ruby:2.6.3-alpine
 ---> 6ddb199f039f
Step 2/12 : RUN apk add --no-cache build-base tzdata postgresql-dev postgresql-client bash
 ---> Running in 386a4486295f
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz
(1/28) Upgrading libcrypto1.1 (1.1.1c-r0 -> 1.1.1d-r2)
(2/28) Upgrading libssl1.1 (1.1.1c-r0 -> 1.1.1d-r2)
(3/28) Installing bash (5.0.0-r0)
Executing bash-5.0.0-r0.post-install
(4/28) Installing binutils (2.32-r0)
(5/28) Installing libmagic (5.37-r1)
(6/28) Installing file (5.37-r1)
(7/28) Installing isl (0.18-r0)
(8/28) Installing libgomp (8.3.0-r0)
(9/28) Installing libatomic (8.3.0-r0)
(10/28) Installing mpfr3 (3.1.5-r1)
(11/28) Installing mpc1 (1.1.0-r0)
(12/28) Installing gcc (8.3.0-r0)
(13/28) Installing musl-dev (1.1.22-r3)
(14/28) Installing libc-dev (0.7.1-r0)
(15/28) Installing g++ (8.3.0-r0)
(16/28) Installing make (4.2.1-r2)
(17/28) Installing fortify-headers (1.1-r0)
(18/28) Installing build-base (0.5-r1)
(19/28) Installing libedit (20190324.3.1-r0)
(20/28) Installing db (5.3.28-r1)
(21/28) Installing libsasl (2.1.27-r4)
(22/28) Installing libldap (2.4.48-r0)
(23/28) Installing libpq (11.6-r0)
(24/28) Installing postgresql-client (11.6-r0)
(25/28) Installing openssl-dev (1.1.1d-r2)

在 ubuntu 中,它永远被冻结为 step (25/28) Installing openssl-dev (1.1.1d-r2)

在mac中,它显示

(25/27) Installing postgresql-libs (11.6-r0)
ERROR: Failed to create usr/lib/libssl.a: No error information
ERROR: openssl-dev-1.1.1d-r2: BAD signature

有什么问题吗?另外,我怎样才能获得更详细的信息/日志,为什么它无法安装openssl-dev

标签: rubylinuxpostgresqldockeropenssl

解决方案


推荐阅读