containers

Docker Cheat Sheet

Get list of containers

docker ps

get names of containers:

docker ps --format "{{.Names}}"

connect / login to a container

docker exec -it container_name /bin/bash

Copy files from local to docker (cp source container_name:destination)

docker cp  myScript.sh container_name:/  

connect to container on remove host

  1. ssh to remote machine
  2. login to the container normally 🙂

Good article: Create a Docker Volume and Specify a Host Directory:

https://www.ionos.com/community/server-cloud-infrastructure/docker/understanding-and-managing-docker-container-volumes