【发布时间】:2021-09-25 04:02:57
【问题描述】:
我一直在尝试构建我的 Docker 映像:
docker build -t <tag> -f Dockerfile.production .
但是,这在捆绑时挂起。 我试过捆绑:
DEBUG_RESOLVER=true bundle install --verbose
在我的主机上运行 bundle 工作正常 - 只有 Docker 映像有这个问题。
附上我的 Dockerfile:
FROM cimg/ruby:2.7.4-node
LABEL maintainer=budgeneration@gmail.com
SHELL ["/bin/bash", "-c"]
USER root
RUN sudo apt-get update && \
apt-get install -y nodejs npm libvips-tools libsodium-dev \
apt-transport-https ca-certificates curl software-properties-common \
librocksdb-dev \
libsnappy-dev \
python3-distutils \
rsyslog --no-install-recommends
# Other tools not related to building by still required.
RUN sudo apt-get install -y ffmpeg gifsicle
USER circleci
# Install all gems first.
# This hits the warm cache if unchanged so bundling is faster.
COPY Gemfile* /tmp/
WORKDIR /tmp
RUN gem install sassc-rails -v 2.1.2
RUN gem install bulma-rails -v 0.9.1
RUN bundle config set without 'development test' \
&& bundle install --verbose \
&& bundle binstubs railties
# Remove yarn (the other yarn)
RUN apt-get purge cmdtest
RUN yarn global add mjml
WORKDIR /sapco
# First we copy just Yarn files, to run yarn install
COPY package.json /sapco
COPY yarn.lock /sapco
RUN yarn install
WORKDIR /sapco
# Now copy everything
COPY . /sapco
EXPOSE 3000
有什么提示可以尝试进一步调试吗?
【问题讨论】:
-
但是,这在捆绑时会挂起 更具体一点可能是个好主意。哪个特定命令导致错误?错误信息是什么?可能是相关信息……你怎么看?
-
没有错误消息,因为它挂起 - 没有完成。该命令使用它列在该行的正下方。
标签: ruby-on-rails docker bundler