I\'m creating an image that has a similar problem like the following docker project:
FROM alpine:3.9.3 COPY ./env.sh /env.sh RUN source
I found an alternative option that I like better:
Configure an ENTRYPOINT dockerfile step, that sources the file, and then runs the CMD received by argument:
ENTRYPOINT ["sh", "-c", "source /env.sh && \"$@\"", "-s"]