How to settings maximal file descriptor e.g using ulimit ?

I have concurrent proccess that’s need to open many file, and send them trough tcp using golang, but when I run the code, it say:

xxxxxx socket: too many open files.

Since your code runs in a VM, you can set this by wrapping your app with a shell script in which you set these values with ulimit. Are you using a Dockerfile?