Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
technical:docker-lab-basic [2026/09/11 20:59] – created systemtechnical:docker-lab-basic [2026/09/11 21:09] (current) – [Useful cleanup / debug] system
Line 71: Line 71:
   * Container 8000 reaching container 8001 internally on port 80, without going through your host ports.   * Container 8000 reaching container 8001 internally on port 80, without going through your host ports.
  
 +====== Useful cleanup / debug ======
 +  * Some handy commands:
 +<code bash>
 +docker ps                           # see running
 +docker network inspect test-radiusdesk  # see which containers + their IPs
 +docker logs nginx-8000
 +docker stop nginx-8000 nginx-8001 && docker rm nginx-8000 nginx-8001
 +docker network rm test-radiusdesk
 +</code>
  
 +====== Same thing with docker-compose (cleaner) ======
 +  * Create docker-compose.yml:
 +<code yaml>
 +services:
 +  nginx-8000:
 +    image: nginx
 +    ports:
 +      - "8000:80"
 +    networks:
 +      - test-radiusdesk
 +
 +  nginx-8001:
 +    image: nginx
 +    ports:
 +      - "8001:80"
 +    networks:
 +      - test-radiusdesk
 +
 +networks:
 +  test-radiusdesk:
 +    driver: bridge
 +</code>
 +  * We can then bring it up with:
 +<code bash>
 +docker compose up -d
 +docker compose down
 +</code>
  
  • technical/docker-lab-basic.1789153198.txt.gz
  • Last modified: 2026/09/11 20:59
  • by system