Home > Net >  Entrypoint: Executable file not found in $PATH: unknown
Entrypoint: Executable file not found in $PATH: unknown

Time:08-10

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 :(

CodePudding user response:

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" ]

CodePudding user response:

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

COPY entrypoint.sh /hermes-app/entrypoint.sh
  • Related