我有一个包含以下步骤的 dockerfile。
FROM ruby:2.4.5-slim
# more build steps
WORKDIR /app
COPY ./Gemfile ./Gemfile.lock ./package.json ./yarn.lock ./
RUN bundle install
RUN yarn install
COPY . .
RUN RAILS_ENV=production bin/rails assets:precompile --trace
# more build steps
有时资产会在几秒钟内完美地预编译,有时预编译会超时。超时仅与 Google Cloud Builder 上的某些构建一致。如果我重新启动超时的构建,该构建将再次超时。我能够在许多不同的机器上构建图像而没有任何问题。
我还能够在本地成功运行 cloubuild 步骤,没有任何问题。