0

In my Dockerfile, I want to run 2 scripts.

I want once the first script ran successfully then only it will run another script because another script is consuming the output of the first script.

What changes do I need to make in Dockerfile to complete this task?

FROM ubuntu

WORKDIR /usr/bin/

COPY ./example.py .

RUN chmod +x example.py

ENTRYPOINT ["python3", "example.py"]

I want to include one move ENTRYPOINT to execute another script.

leopal
  • 4,711
  • 1
  • 25
  • 35
Rukender
  • 49
  • 2
  • 7

1 Answers1

0

Command chaining && will help. Reference Dockerfile considering you have scripts placed under scripts folder on your system.

FROM python:3.7-alpine
COPY ./scripts /scripts 
WORKDIR /scripts
RUN chmod +x /scripts/script-1.sh && chmod +x /scripts/script-2.sh
RUN /scripts/script-1.sh && /scripts/script-2.sh
Shashank Sinha
  • 492
  • 2
  • 7