Docker Basics

  1. Build

    sudo docker -t <target-name> -f Dockerfile .
    
  2. Run

    • With bash
      sudo docker run --rm -it --device /dev/kfd --device /dev/dri --security-opt seccomp=unconfined <target-name> /bin/bash
      
    • Without bash
      sudo docker run --rm --device /dev/kfd --device /dev/dri --security-opt seccomp=unconfined rochpl.6.0  mpirun_rochpl -P 1 -Q 1 -N 45312
      
    • Mount a Directory
      sudo docker run --rm -it --device /dev/kfd --device /dev/dri --security-opt seccomp=unconfined --network host --name rochpl_node -v <directory>:/opt rochpl /usr/sbin/sshd -D
      
  3. Update Docker

    • commit the changes
      docker ps # to get the container id
      
      docker commit <containerID> <imageid>
      
  4. Clean

    # remove all images
    sudo docker system prune -a 
    sudo docker container prune
    sudo docker buildx prune -f