Skip to content

Wiki

Quickly open a terminal in Docker

About 2 min read

Goal: To be able to enter a command in my local terminal, and then quickly enter the terminal of a certain Docker container.

You can first open the VSCode extensions to see what images you have.

alt text

For example, myros_jazzy_opencv_cudaandros_opencv_cudaare the mirrors of jazzy and humble respectively.

Then edit it~/.bashrc and append at the end

# Docker快速进入终端命令
alias djazzy='docker exec -it ros_jazzy_opencv_cuda bash'
alias dhumble='docker exec -it ros_opencv_cuda bash'

Open a new terminal and typedjazzyto enter the jazzy terminal.

alt text