Use only one ‘RUN’ statement. It’s a best practice as it will reduce the size taken by your image.
This is how you can pass an argument to docker build.
Dockerfile:
...
ARG NEW
COPY ./compose/local/django/new.sh /new.sh
COPY ./compose/local/django/start.sh /start.sh
RUN if [ "$NEW" = "True" ]; then \
sed -i 's/\r//' /new.sh && \
chmod +x /new.sh; \
else \
sed -i 's/\r//' /start.sh && \
chmod +x /start.sh; \
fi
and build it like this
docker build --build-arg NEW="True" .