skip to Main Content

I’m trying to run a Dockerfile but apparently my entrypoint.sh does not work.

ERROR: for hermes Cannot start service hermes: failed to create shim
task: OCI runtime create failed: runc create failed: unable to start
container process: exec: "entrypoint.sh": executable file not found in
$PATH: unknown

Here my dockerfile:

FROM debian:buster

#SHELL ["/bin/bash", "-c"]

# Ruby configuration
ARG ruby_version=3.1.1

# Install system dependencies
RUN apt-get update && apt-get install -y 
    apt-transport-https 
    ca-certificates 
    curl 
    gnupg-agent 
    software-properties-common 
    gnupg 
    gpg-agent 
    ruby-full 
    ruby-dev 
    procps 
    libpq-dev 
    git

# Create the workspace into the container
RUN mkdir -p /hermes-app && 
    chmod -R 777 /hermes-app
COPY srcs/ /hermes-app/
COPY scripts/rvm.sh /hermes-app/rvm.sh
COPY scripts/gems.sh /hermes-app/gems.sh
RUN chmod +x /hermes-app/rvm.sh
RUN chmod +x /hermes-app/gems.sh

# Time: 454s (9mtin) for the installation of RVM
RUN bash /hermes-app/gems.sh
RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import -
RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
RUN curl -sSL https://get.rvm.io | bash -s stable --ruby
RUN bash /hermes-app/rvm.sh $ruby_version
RUN chmod -R 777 /usr/local/rvm/gems/ruby-${ruby_version}

# Create user
WORKDIR /hermes-app
RUN useradd -m -s /bin/bash moderator
USER moderator
RUN echo "source /usr/local/rvm/scripts/rvm" >> ~/.bashrc

ENTRYPOINT [ "entrypoint.sh" ]

My path in local is like:

Me:hermes-app$ ls
Dockerfile    db            entrypoint.sh scripts       srcs

Thanks in advance 🙁

2

Answers


  1. You would also need to copy the entrypoint.sh script into the container by adding this line:

    COPY entrypoint.sh /hermes-app/entrypoint.sh
    
    Login or Signup to reply.
  2. You need to add entrypoint.sh to your container and give it correct executable permissions to run it:

    ADD entrypoint.sh /hermes-app/entrypoint.sh
    RUN chmod +x /hermes-app/entrypoint.sh
    ENTRYPOINT [ "/hermes-app/entrypoint.sh" ]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search