Getting an error while starting up nginx container

Viewed 11

I'm using dockerfile to create an nginx image and it is created successfully but when I try to start the container I get below error

Error - exec /docker-entrypoint.sh: no such file or directory

If I use /bin/bash as an entrypoint then I can see that the /docker-entrypoint.sh is present inside the image.

FROM linux:8
ARG USER="oracle"
RUN useradd --create-home --home-dir /app --shell /bin/bash ${USER} && \
    dnf update -y && \
    dnf module install -y nginx:1.20 && \
    dnf clean all && \
    ln -sf /dev/stdout /var/log/nginx/access.log && \
    ln -sf /dev/stderr /var/log/nginx/error.log && \
    mkdir /var/cache/nginx && \
    chown -R ${USER}:${USER} /var/cache/nginx && \
    chmod -R 775 /var/cache/nginx && \
    chown -R ${USER}:${USER} /var/lib/nginx && \
    chown -R ${USER}:${USER} /var/log/nginx && \
    chown -R ${USER}:${USER} /etc/nginx && \
    chmod -R 775 /etc/nginx
COPY --chown=oracle:oracle conf.d /etc/nginx/conf.d
COPY --chown=oracle:oracle nginx.conf /etc/nginx/
COPY --chown=oracle:oracle docker-entrypoint.d /docker-entrypoint.d
COPY --chown=oracle:oracle docker-entrypoint.sh /

ENTRYPOINT ["/docker-entrypoint.sh"]

USER ${USER}
WORKDIR /app
STOPSIGNAL SIGQUIT
EXPOSE 8000
CMD ["nginx", "-g", "daemon off;"]

0 Answers
Related