I have two problem Statement for running the docker container.
- Run two instances of a docker container.
I am running a container say test-service. When I execute the command Only one container named as test-service get created. I want to change the command and create one more instance of the container.
- Dynamic Port number Allocation to the container.
I am binding the port say 8080:8080. I want to configure it in such a way that the port number will be dynamic.
The command which I am using to run the container is as below:
docker run -p ${EXTERNAL_PORT_NUMBER}:${INTERNAL_PORT_NUMBER} --network ${NETWORK} --name ${SERVICE_NAME} --restart always -m 1024M --memory-swap -1 -itd ${ORGANISATION}/${SERVICE_NAME}:${VERSION}
The test-service is a node service.
Please let me know what modifications are needed in the above command.