wiki:docker_commands
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| wiki:docker_commands [2020/12/14 09:50] – created antisa | wiki:docker_commands [2025/11/04 10:00] (current) – add Print IPs for all containers antisa | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| // | // | ||
| + | ===== Get container IP ===== | ||
| + | |||
| + | docker inspect -f ' | ||
| + | |||
| + | ===== Run kibana ===== | ||
| + | Run kibana on http:// | ||
| + | |||
| + | docker run --name kib-01 -e ELASTICSEARCH_HOSTS=http:// | ||
| + | |||
| + | Run another instance simultaneously on 5602 port | ||
| + | docker run --name kib-02 -e ELASTICSEARCH_HOSTS=http:// | ||
| + | |||
| + | ===== Remove only dangling volumes ===== | ||
| + | |||
| + | Use this because of [[https:// | ||
| + | docker volume rm $(docker volume ls -q -f dangling=true) | ||
| + | |||
| + | ===== Connect to different docker daemon running on different port ===== | ||
| + | Example connecting to [[wiki: | ||
| + | docker -H tcp:// | ||
| + | |||
| + | You will get error //Error response from daemon: Client sent an HTTP request to an HTTPS server//. You have to point the docker client to use the certificates e.g. | ||
| + | |||
| + | docker --tlsverify --tlscacert=/ | ||
| + | |||
| + | ===== How to determine what containers use the docker volume? ===== | ||
| + | docker ps -a --filter volume=VOLUME_NAME_OR_MOUNT_POINT | ||
| + | |||
| + | ===== Remove images older than 2 weeks ===== | ||
| + | |||
| + | docker image prune -a --filter " | ||
| + | |||
| + | The second command removes dangling build cache which will reclaim the disk space after image deletion. | ||
| + | |||
| + | ===== Print IPs for all containers ===== | ||
| + | |||
| + | docker ps -a --format "table {{.ID}}\t{{.Names}}\t{{.Image}}" | ||
| + | | tail -n +2 \ | ||
| + | | while read -r id name image; do | ||
| + | ip=$(docker inspect --format=' | ||
| + | printf " | ||
| + | done | ||
wiki/docker_commands.1607939426.txt.gz · Last modified: by antisa
