0

I have created docker container with fluent-bit but when I try to execute the docker entrypoint.sh I'm getting permission denied. below i attached the docker file

FROM fluent/fluent-bit:1.4-debug

USER root


ADD ./docker-fluentbit-entrypoint.sh /fluent-bit

CMD ["chmod", "+x", "/fluent-bit/docker-fluentbit-entrypoint.sh"]

ADD fluent-bit.conf /fluent-bit/etc/

WORKDIR /fluent-bit

ENTRYPOINT ["/fluent-bit/docker-fluentbit-entrypoint.sh"]

getting below error message

docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/fluent-bit/docker-fluentbit-entrypoint.sh\": permission denied": unknown.
HARINI NATHAN
  • 217
  • 3
  • 12

1 Answers1

0

Replace your CMD command by RUN command.

RUN chmod +x /fluent-bit/docker-fluentbit-entrypoint.sh

CMD executes when you launch the built image while RUN is an image build step.

Ayush Pallav
  • 919
  • 9
  • 18