I want to build a Docker Ubuntu image with Ruby 2.3.8 and loaded with foreman. I constructed this Dockerfile
# sshd
#
# VERSION 0.0.1
FROM drecom/ubuntu-base:latest
MAINTAINER Drecom Technical Development Department <pr_itn@drecom.co.jp>
RUN git clone git://github.com/rbenv/rbenv.git /usr/local/rbenv \
&& git clone git://github.com/rbenv/ruby-build.git /usr/local/rbenv/plugins/ruby-build \
&& git clone git://github.com/jf/rbenv-gemset.git /usr/local/rbenv/plugins/rbenv-gemset \
&& /usr/local/rbenv/plugins/ruby-build/install.sh
ENV PATH /usr/local/rbenv/bin:$PATH
ENV RBENV_ROOT /usr/local/rbenv
RUN echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh \
&& echo 'export PATH=/usr/local/rbenv/bin:$PATH' >> /etc/profile.d/rbenv.sh \
&& echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
RUN echo 'export RBENV_ROOT=/usr/local/rbenv' >> /root/.bashrc \
&& echo 'export PATH=/usr/local/rbenv/bin:$PATH' >> /root/.bashrc \
&& echo 'eval "$(rbenv init -)"' >> /root/.bashrc
ENV CONFIGURE_OPTS --disable-install-doc
ENV PATH /usr/local/rbenv/bin:/usr/local/rbenv/shims:$PATH
ENV RBENV_VERSION 2.3.8
RUN eval "$(rbenv init -)"; rbenv install $RBENV_VERSION \
&& eval "$(rbenv init -)"; rbenv global $RBENV_VERSION \
&& eval "$(rbenv init -)"; gem update --system \
&& eval "$(rbenv init -)"; gem install bundler -f \
&& rm -rf /tmp/*
WORKDIR /myapp
COPY . .
RUN cd /myapp
RUN bin/bundle install
RUN apt-get install -y ruby-foreman
RUN foreman start
However upon running my Docker build command, (docker build -t my_image .), my container fails to even install foreman. Not sure if I’m using the right package but here’s the output …
=> ERROR [10/11] RUN apt-get install -y ruby-foreman 7.1s
------
> [10/11] RUN apt-get install -y ruby-foreman:
#13 0.371 パッケージリストを読み込んでいます...
#13 1.504 依存関係ツリーを作成しています...
#13 1.671 状態情報を読み取っています...
#13 1.798 以下の追加パッケージがインストールされます:
#13 1.799 fonts-lato libruby2.3 libyaml-0-2 rake ruby ruby-did-you-mean ruby-dotenv
#13 1.799 ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby-thor
#13 1.799 ruby2.3 rubygems-integration unzip zip
#13 1.801 提案パッケージ:
#13 1.801 ri ruby-dev ruby-foreman-doc bundler
#13 1.802 以下のパッケージが新たにインストールされます:
#13 1.802 fonts-lato libruby2.3 libyaml-0-2 rake ruby ruby-did-you-mean ruby-dotenv
#13 1.802 ruby-foreman ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit
#13 1.802 ruby-thor ruby2.3 rubygems-integration unzip zip
#13 2.706 アップグレード: 0 個、新規インストール: 17 個、削除: 0 個、保留: 0 個。
#13 2.706 6,316 kB のアーカイブを取得する必要があります。
#13 2.706 この操作後に追加で 28.4 MB のディスク容量が消費されます。
#13 2.706 取得:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 fonts-lato all 2.0-1 [2,693 kB]
#13 4.725 取得:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 libyaml-0-2 amd64 0.1.6-3 [47.6 kB]
#13 4.920 取得:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 rubygems-integration all 1.10 [4,966 B]
#13 4.920 取得:4 http://archive.ubuntu.com/ubuntu xenial/main amd64 ruby-did-you-mean all 1.0.0-2 [8,390 B]
#13 4.921 取得:5 http://archive.ubuntu.com/ubuntu xenial/main amd64 ruby-minitest all 5.8.4-2 [36.6 kB]
#13 4.926 取得:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 ruby-net-telnet all 0.1.1-2 [12.6 kB]
#13 4.927 取得:7 http://archive.ubuntu.com/ubuntu xenial/main amd64 ruby-power-assert all 0.2.7-1 [7,668 B]
#13 4.927 取得:8 http://archive.ubuntu.com/ubuntu xenial/main amd64 ruby-test-unit all 3.1.7-2 [60.3 kB]
#13 4.934 エラー:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libruby2.3 amd64 2.3.1-2~16.04.6
#13 4.934 404 Not Found [IP: 91.189.88.142 80]
#13 4.935 無視:10 http://security.ubuntu.com/ubuntu xenial-security/main amd64 ruby2.3 amd64 2.3.1-2~16.04.6
#13 4.935 取得:11 http://archive.ubuntu.com/ubuntu xenial/main amd64 ruby all 1:2.3.0+1 [5,530 B]
#13 5.116 取得:12 http://archive.ubuntu.com/ubuntu xenial/main amd64 rake all 10.5.0-2 [48.2 kB]
#13 5.120 取得:13 http://archive.ubuntu.com/ubuntu xenial/universe amd64 ruby-dotenv all 2.0.2-1 [9,384 B]
#13 5.121 取得:14 http://archive.ubuntu.com/ubuntu xenial/universe amd64 ruby-thor all 0.19.1-2 [43.7 kB]
#13 5.131 取得:15 http://archive.ubuntu.com/ubuntu xenial/universe amd64 ruby-foreman all 0.78.0-3 [20.3 kB]
#13 5.134 取得:16 http://archive.ubuntu.com/ubuntu xenial/main amd64 unzip amd64 6.0-20ubuntu1 [158 kB]
#13 5.137 取得:17 http://archive.ubuntu.com/ubuntu xenial/main amd64 zip amd64 3.0-11 [158 kB]
#13 6.894 エラー:9 http://security.ubuntu.com/ubuntu xenial-security/main amd64 libruby2.3 amd64 2.3.1-2~16.04.6
#13 6.894 404 Not Found [IP: 91.189.88.142 80]
#13 7.088 エラー:10 http://security.ubuntu.com/ubuntu xenial-security/main amd64 ruby2.3 amd64 2.3.1-2~16.04.6
#13 7.088 404 Not Found [IP: 91.189.88.142 80]
#13 7.098 E: http://security.ubuntu.com/ubuntu/pool/main/r/ruby2.3/libruby2.3_2.3.1-2~16.04.6_amd64.deb の取得に失敗しました 404 Not Found [IP: 91.189.88.142 80]
#13 7.098
#13 7.098 E: http://security.ubuntu.com/ubuntu/pool/main/r/ruby2.3/ruby2.3_2.3.1-2~16.04.6_amd64.deb の取得に失敗しました 404 Not Found [IP: 91.189.88.142 80]
#13 7.098
#13 7.098 E: いくつかのアーカイブを取得できません。apt-get update を実行するか --fix-missing オプションを付けて試してみてください。
#13 7.098 3,315 kB を 5秒 で取得しました (640 kB/s)
------
executor failed running [/bin/sh -c apt-get install -y ruby-foreman]: exit code: 100
What’s the proper way to add foreman to the container and start it?