当我运行sudo docker build
时,一切顺利,直到红宝石安装。
我收到此错误
Step 17 : RUN ruby-install ruby
---> Running in acfbb2c565ed
>>> Installing ruby 2.1.3 into /home/app/.rubies/ruby-2.1.3 ...
>>> Installing dependencies for ruby 2.1.3 ...
/usr/local/bin/../share/ruby-install/ruby-install.sh: line 104: sudo: command not found
!!! Installing dependencies failed!
The command '/bin/sh -c ruby-install ruby' returned a non-zero code: 255
这是在我的Dockerfile中:
FROM ubuntu:wily
MAINTAINER Mertcan Cam <mertcancam@gmail.com>
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update
RUN apt-get update -y
RUN apt-get install -y curl wget ca-certificates build-essential autoconf python-software-properties libyaml-dev
RUN apt-get install -y libssl-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev bison openssl make git libpq-dev libsqlite3-dev nodejs
RUN apt-get clean
RUN echo %sudo ALL=NOPASSWD: ALL >> /etc/sudoers
RUN wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz && tar -xzvf ruby-install-0.5.0.tar.gz && cd ruby-install-0.5.0/ && make install
RUN wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz && tar -xzvf chruby-0.3.9.tar.gz && cd chruby-0.3.9/ && make install
RUN rm -rf /var/cache/apt/* /tmp/*
RUN useradd -m -G sudo app
USER app
WORKDIR /home/app
RUN ruby-install ruby
RUN rm -rf /home/app/src