Using Gurobi Optimizer with Docker requires two separate components.
First, you must designate a computer that will run the Gurobi token server (grb_ts). The Gurobi token server, which uses the token server license file, must be installed outside of the Docker container. This must be on a machine that your container has a network connection to; this can be a physical computer (e.g., the machine hosting the Docker container), a virtual machine, or a cloud machine. For instructions on setting up the token server, see Starting a token server.
Second, the Docker containers require Gurobi Optimizer and a client license file. To create a client license file, follow the instructions here.
The optimization workers can then perform the optimization inside the Docker container. However, you will need to ensure that the worker placement is appropriate so that powerful hardware is reserved for those containers in order to prevent performance degradation.