Deploy Jenkins With docker-compose

The docker-compose yaml file as follows:

---
version: '3'

services:
  jenkins:
    image: jenkins/jenkins:lts-jdk11
    privileged: true
    user: root
    restart: always
    ports:
      - 50000:50000
      - 8088:8080 # local port is 8088, container port is 8080
    volumes:
      - /data/work/jenkins/jenkins_home:/var/jenkins_home
    container_name: jenkins
    networks:
      jenkins:
        ipv4_address: 172.16.128.2
    environment:
      - TZ=Asia/Shanghai

  centos6:
     image: centos6-i386:20220321
     container_name: centos6-i386
     restart: always
     expose:
      - "22"
     networks:
       jenkins:
          ipv4_address: 172.16.128.6
     command: /bin/bash -c '/usr/sbin/sshd -D && /bin/bash'
     volumes:
       - /data/work/jenkins/centos6-i386/home/centos:/home/centos

  centos7:
    image: centos7:20220321
    container_name: centos7
    restart: always
    expose:
      - "22"
    networks:
      jenkins:
        ipv4_address: 172.16.128.7
    command: /bin/bash -c '/usr/sbin/sshd -D && /bin/bash'
    volumes:
      - /data/work/jenkins/centos7/home/centos:/home/centos

networks:
  jenkins:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.16.128.0/24
          gateway: 172.16.128.1

Since the slave nodes, centos6 and centos7 container's image is migrated from another host, and some issues occurred during the migration, the solution logged at Docker Note .