This image contains a Terraria 1.3.5.3 server with automatic world generatation and the possibility to store / inject a world using a Docker mount
You can simply run the image with the default settings:
$ docker run -d --name=terraria -p 7777:7777 luzifer/terraria
If you want the world to persist you can mount a volume into the container:
$ docker run -d --name=terraria -p 7777:7777 -v ~/terraria:/data luzifer/terraria
In case you want to use the console commands on the Terraria server this image has a helper for you:
$ docker exec terraria terraria_cmd save