I create a DocherFile with OpenJDK base image and run init.sh script.
I want to inherit that Dockerfile and override the init.sh to test.sh script.
Is it possible to "test" docker file inherit from or extends "my-app" docker file and override ENTRYPOINT?
Should I define both "my-app" and "test" dockers in docker-compose? Can I run only test docker with docker-compose and not both?
My purpose is to run only "my-app" docker in production. But for tests, I want to extend it and run tests and some more configurations.
my-app/Dockerfile:
FROM openjdk:11-jre-slim
COPY initialization.sh /path/
ENTRYPOINT ["/bin/bash", "-c", "/path/init.sh"]
test/Dockerfile:
FROM my-app
COPY tset.sh /path/
ENTRYPOINT ["/bin/bash", "-c", "/path/tset.sh"]