• docker-compose.yml
    version: '3.8'
    services:
    ubuntu:
      image: ubuntu:latest 
      restart: always
      #network_mode: host
      container_name: ubuntu_1022
      volumes:  
        - ./data:/data
      ports:
        - "22:22"
      tty: true
    
  • cmd进入容器内部
docker exec -it ubuntu_1022 bash