Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
YouTube Security VideosMicrosoft Mechanics: A Copilot Agent Writes the Status Report(23.09.2026 um 03:30 Uhr)
•
Sichere ProgrammierungOpenTelemetry in the GitHub Copilot app(23.09.2026 um 04:14 Uhr)
•
Sichere ProgrammierungMy Introduction:(23.09.2026 um 03:53 Uhr)
••
Sichere ProgrammierungAgentWallex: Content Day (Articles going live)(23.09.2026 um 04:00 Uhr)
••••
Sichere ProgrammierungYour Low-Code Platform Is Fast Until a Customer Builds One Real Table(23.09.2026 um 04:11 Uhr)
••
YouTube Security VideosMicrosoft Mechanics: A Copilot Agent Writes the Status Report(23.09.2026 um 03:30 Uhr)
•
Sichere ProgrammierungOpenTelemetry in the GitHub Copilot app(23.09.2026 um 04:14 Uhr)
•
Sichere ProgrammierungMy Introduction:(23.09.2026 um 03:53 Uhr)
••
Sichere ProgrammierungAgentWallex: Content Day (Articles going live)(23.09.2026 um 04:00 Uhr)
••••
Sichere ProgrammierungYour Low-Code Platform Is Fast Until a Customer Builds One Real Table(23.09.2026 um 04:11 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

Docker – Port Mapping, Logs, Container Management, and Image Removal

Docker – Logs, Remove, and Port Mapping Port Mapping When we run an application inside a container, we define the port on which the application will run. The container runs the application on that port. It is not possible to a…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Docker – Logs, Remove, and Port Mapping






Port Mapping



When we run an application inside a container, we define the port on which the application will run. The container runs the application on that port.



It is not possible to access an application running inside Docker from outside the container unless port mapping is configured.



Port mapping is specified using the -p option.



Syntax:




docker run -p <host_port>:<container_port>






Example:




docker run -p 8888:8080






Here:





  • 8888 is the host (machine) port used to access the application from outside the container.


  • 8080 is the port defined in the application and exposed inside the container.



If the host port is already in use, Docker displays an error message.






How to Check Which Ports Are Being Used by Docker Containers






docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}"












Detached Mode



To run a container in detached mode, use the -d option.




docker run -d -p 2000:2001






Detached mode means the container runs in the background.









Docker Logs



Logs contain information about the activities happening inside a container.






View Logs of a Specific Container






docker logs <container_id>









Follow Logs Continuously






docker logs -f <container_id>






-f stands for follow.






View Logs from a Specific Time Range






Seconds (s): docker logs --since 30s <container_id>
Minutes (m): docker logs --since 5m <container_id>
Hours (h): docker logs --since 2h <container_id>






Docker supports seconds (s), minutes (m), and hours (h) for relative time.



For days, weeks, months, or years, use an ISO 8601 date or timestamp.




Weeks:  docker logs --since 2026-06-14 <container_id>
Months: docker logs --since 2026-05-21 <container_id>
Years: docker logs --since 2025-06-21 <container_id>









Combined Time Units






docker logs --since 1h30m <container_id>






Displays logs from 1 hour and 30 minutes ago.






Exact Time






docker logs --since "2026-06-21T17:30:00" <container_id>






Displays logs generated since the specified date and time.









Docker Inspect



docker inspect is used to view detailed information about a container, image, network, or volume.




docker inspect <container_id>












Access a Running or Exited Container



To open a shell inside a running container:




docker exec -it <container_id> sh








  • -i = Interactive mode


  • -t = Allocate a terminal









Docker Remove






Delete an Exited Container






docker rm <container_id>









Delete a Running Container






docker rm -f <container_id>






-f forcefully stops and removes the container.






Alternative Method



First stop the container:




docker stop <container_id>






Then remove it:




docker rm <container_id>












Delete Multiple Containers






docker rm -f <container_id1> <container_id2> <container_id3>









Alternative Method (Windows)






FOR /F "tokens=*" %i IN ('docker ps -aq') DO docker rm -f %i






This command removes all containers.









Listing Containers






View Running Containers






docker ps






ps stands for Process Status.



This command lists only running containers.






View All Containers






docker ps -a






This command lists all containers, including exited containers.



-a stands for all.






View Only Container IDs






docker ps -aq






This command lists all container IDs.









Delete Images






docker rmi -f <image_id>






This command forcefully removes an image.









Naming a Container



To assign a name to a container:




docker run -d --name anyname busybox:1.36






Example:




docker run -d --name my-container busybox:1.36






This creates a container with the name my-container.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Docker – Port Mapping, Logs, Container Management, and Image Removal

Thematisch verwandte Begriffe: Docker, Port, Mapping, Logs · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-17636 | IBM Financial Transaction Manager (FTM) for RedHat OpenShift could allow…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger • Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick