我正在尝试使用docker文件为Ruby on Rails应用程序创建docker镜像。
我得到的错误
Step 8/11 : RUN gem install bundler:2.3.24
---> Running in 19f290ad8c53
ERROR: Could not find a valid gem 'bundler' (= 2.3.24), here is why:
Unable to download data from https://rubygems.org/ - Net::OpenTimeout: Net::OpenTimeout (https://rubygems.org/specs.4.8.gz)
The command '/bin/sh -c gem install bundler:2.3.24' returned a non-zero code: 2
docker文件是
FROM ubuntu:22.04
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs ruby-full
RUN gem update --system
ENV GEM_HOME="/usr/local/bundle"
ENV PATH $GEM_HOME/bin:$GEM_HOME/gems/bin:$PATH
# Install bundler and gems
COPY Gemfile Gemfile.lock ./
ENV BUNDLER_VERSION=2.3.24
RUN gem install bundler:2.3.24
RUN bundle install
# Copy the rest of the application code
COPY . .
# Start your Rails application
CMD ["rails", "server", "-b", "0.0.0.0"]
注意:我得到这个错误只在这台服务器上,但在其他服务器上工作正常!
请让我知道如果有丢失的信息
我尝试重新启动Docker如下sudo service docker restart
但还是一样
我也试过sudo docker prune system
出事
1条答案
按热度按时间oyt4ldly1#
谢谢你们告诉我网络错误
我在我的接口与docker中查找MTU
Docker使用的MTU高于接口
我寻找解决方案,看到了这个参考资料
MTU Overwrite