docker related instructions

  1. View docker images:
    docker images can view all docker images in the current server
    docker images | grep wu can use pipelines to filter images containing wu

  2. Docker operation:
    docker run -it -v /mnt/storage00/wusiyu:/workspace/storage00/wusiyu hub.bilibili.co/wusiyu/torch:latest run an image, so as to run a container
    –name xxx, you can name the
    container- it, an interactive terminal, requires a terminal when running the container
    -v The actual physical address of the server file: the file address mapped in docker (the code in docker will not be bound to the server if v is not added) /bin/bash
    , Start the container from the command line

  3. Common use of docker:
    shortly exit ctrl+p+q
    and enter docker again attach wusiyu1 (container name)
    After modification, you need to commit to save docker
    docker commit wusiyu1 hub.bilibili.co/wusiyu/torch:latest
    After commit, you need to push to dockerhub The link in the platform is successful
    docker push hub.bilibili.co/wusiyu/torch:latest
    Note: If the push fails, it may be because there is no login
    Login method: docker login hub.bilibili.co -u wusiyu and then enter the password
    docker ps: View current The running container
    docker commit container name image name: tag: save the container as an image, and store the changes to the dependent environment during the running of the container docker
    logs docker
    attach container name: re-enter the container
    docker push image name: tag: put the image Upload to dockerhub

  4. docker temporarily exit the terminal and enter the container again
    docker exec -it wusiyu1 /bin/bash
    insert image description here

  5. After entering, view the record
    docker logs wusiyu1 | tail -n 500
    (the latest 500 lines)

Guess you like

Origin blog.csdn.net/poppyty/article/details/118383475