Select Page

Depending on how installation was done you would need (or not need) to run these commands with sudo.

  • start container detached:
    docker -d ....
  • see events from docker (in second terminal):
    docker events
  • show running containers:
    docker ps
  • bash shell directly on container:
    docker exec -i -t containerID /bin/bash
    • you will get prompt like this: root@012e3a62e3d0:/#
    • you are connected to docker container as “root” so do not use “sudo” here anymore 🙂
    • leave with simple “exit”
  • connect to not running container:
    docker run -i -t --entrypoint /bin/bash imageID
  • copy file from docker image to local dir:
    docker cp 012e3a62e3d0:/usr/share/grafana/public/dashboards/home.json . 
  • but in reality all files are still on your local disk:
     sudo ls -la /var/lib/docker/aufs/mnt/c9653408f7c60ab4951e3b40f3cedca095aeb9876d7a760d0945c981050315e8/usr/share/grafana/public/dashboards/

    this command requires “sudo”

  • show all parameters (full starting command) of running images:
    docker ps -a --no-trunc