Rewrite to handle instance setup in entrypoint.sh