The invention relates to a method for dynamically creating docker container nodes to execute tasks based on jenkins real-time tasks, which comprises the following steps: A, a customized script for generating docker files is developed, and a docker
file format file is dynamically generated so as to generate a container
mirror image; B, a jenkins plug-in is developed in a customized mode, jenkins job queuing
queue information is obtained in real time, a container
mirror image is dynamically started, the container
mirror image is registered as a jenkins slave node, and a jenkins job task is completed; C, the jenkins plug-in counts the number of jenkins jobs in operation in real time, and the jenkins plug-in counts the number of jenkins jobs in operation in real time; the number is compared with a set maximum parallel number, and if the number of the jenkins queues is less than the maximum parallel number, job information is obtained from a
database for storing real-time jenkins job queuing
queue information, a container is started as a jenkins slave according to the job information, and a task set is executed by the jenkins job. According to the method, resources do not need to be occupied for a long time, in a scene with a large number of concurrent tasks, a large number of resources can be saved by automatically destroying the container nodes, the maximum jenkins
job number canbe dynamically adjusted according to actual conditions, the service requirements are met, and the
resource utilization rate is increased.