The first link is about using docker commands in your Jenkins job to build your software. For example, your tools are inside docker containers and you want to run docker run --it maven:latest build against your code. It is normally a single step in the build job. The second link is about running a Jenkins agent as a docker container and running tools inside the container against your code. Here you will run a Jenkins agent, that will get the job definition from the Jenkins master and the execute the job's steps, i.e. more than one step also while being contained.