Hi Joel,
Have you already generated the container, and want to write into it, or are you still creating with bootstrap? The docker commands RUN and ADD correspond with Dockerfiles, which would correspond with our build recipe (a file called Singularity). If this is the case, you can write these commands / make writable changes during bootstrap. If it's not and you need to make changes inside the container after you've generated it, you need sudo with --writable, no ifs ands or buts. So in summary, a few ways to go about this:
1. Have the sed command happen during the bootstrap, so the changed file is shipped as part of the container. You could then have the port be an environment variable.
2. The other option is to --bind the directory / file at runtime, sort of how you might with docker-compose. Eg:
singularity run -B /path/host:/etc/nginx container-img
So the file in /path/host/nginx.conf is then found in the container as the same.
Best,
Vanessa