Skip to content
Thierry Lam edited this page Aug 11, 2023 · 4 revisions
  1. Build image from Dockerfile in the current directory:

     docker build -t="tlam/myproj:v1" .
    
  2. Run shell in a container

     docker run -t -i tlam/myproj:v1 /bin/bash
    
  3. Push to docker hub

     docker push tlam/myproj
    
  4. Stop a container named pensive_tesla

     docker stop pensive_tesla
    
  5. Remove all docker containers

     docker rm `docker ps --no-trunc -aq`
    
  6. List docker containers

     docker ps
    
  7. ssh into a docker container with the container id

     docker exec -it f9b48df9f27c bash
    
  8. ssh into a docker container using the service name server

     docker-compose exec server bash
    
  9. Connect from a container to a service on the host

     http://host.docker.internal
    
Clone this wiki locally