You can directly mount a repository volume, and there you can customise your config file. No need to keep running
docker exec I also strongly suggest to specify the docker tag, as the latest version is not always the stable one.
docker run -v $PWD/ipfs:/data/ipfs -it ipfs/go-ipfs:v0.4.18
Then you can modify the file as you wish and restart the container when you want.
As an alternative you can just run a shell and run the commands from the container:
docker run -v $PWD/ipfs:/data/ipfs -it --entrypoint /bin/sh ipfs/go-ipfs:v0.4.18
Then you can run all the ipfs commands as you did, but without
docker exec ...
I hope it will help