-
Notifications
You must be signed in to change notification settings - Fork 13
docker_examine_container
M1chaelM edited this page Dec 2, 2020
·
1 revision
You may need to interact with your container to troubleshoot or simply verify that it is working as you expect. One way to do this is to run with the default entrypoint and then open an interactive terminal.
First, run the following to start your container:
docker run --name my_container <USERNAME>/<IMAGE_REPOSITORY_NAME>:<TAG>
Then in a different terminal, run:
docker exec -it my_container bash
This allows you to enter the running container and investigate. For example:
source /opt/ros/melodic/setup.bash
rostopic list
/vorc/thrusters/left_thrust_cmd
/vorc/thrusters/right_thrust_cmd
/rosout
/rosout_agg
rostopic echo /vorc/thrusters/left_thrust_cmd
data: 2.0
---
data: 2.0
---
Finally, you can exit with
exit
To kill the container from outside the container, run:
docker kill my_container