Skip to main content

Container management


Chapter objectives

  • Create containers through the interface
  • Manage the container lifecycle
  • Use logs and the console
  • Monitor performance

1 - Create a container

Via the interface

  1. Go to Containers > + Add container
  2. Configure the parameters

Basic parameters

┌─────────────────────────────────────────────────────────────────┐
│ + Add container │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Name: [mon-nginx ] │
│ │
│ Image: [nginx:alpine ] [🔍 Search] │
│ │
│ ☐ Always pull the image │
│ │
└─────────────────────────────────────────────────────────────────┘

Port configuration

┌─────────────────────────────────────────────────────────────────┐
│ Network ports configuration │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ☑ Publish all exposed ports │
│ │
│ Manual port mapping: │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Host Container Protocol │ │
│ │ [8080 ] [80 ] [TCP ▼] [+ Add port] │ │
│ │ [8443 ] [443 ] [TCP ▼] [🗑️] │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Advanced configuration

TabOptions
Command & loggingCommand, entrypoint, working dir, user, console
VolumesBind mounts, volumes, tmpfs
NetworkNetwork mode, hostname, DNS, hosts
EnvEnvironment variables
LabelsDocker labels
Restart policyRestart policy
Runtime & ResourcesCPU/memory limits, privileges
CapabilitiesLinux capabilities

Example: Create an nginx container

Paramètres:
- Name: web-server
- Image: nginx:alpine
- Ports: 8080:80
- Volume: ./html:/usr/share/nginx/html
- Restart policy: Unless stopped

2 - Actions on containers

Quick actions

IconActionDescription
▶️StartStart the container
⏹️StopStop gracefully
🔄RestartRestart
⏸️PausePause
▶️UnpauseResume
🔪KillForce stop (SIGKILL)
🗑️RemoveRemove

Advanced actions

ActionDescription
Duplicate/EditCreate a copy or modify
RecreateRecreate with the same config
AttachAttach the terminal
LogsView the logs
InspectFull JSON
StatsReal-time metrics

3 - Container logs

Log visualization

┌─────────────────────────────────────────────────────────────────┐
│ 📋 Logs - nginx │
├─────────────────────────────────────────────────────────────────┤
│ Options: [Auto-refresh ☑] [Timestamps ☑] [Lines: 100 ▼] │
│ [Wrap ☑] [Download] │
├─────────────────────────────────────────────────────────────────┤
│ 2024-01-15 10:30:05 /docker-entrypoint.sh: Launching nginx │
│ 2024-01-15 10:30:05 nginx: [notice] using the "epoll" event │
│ 2024-01-15 10:30:06 192.168.1.1 - - "GET / HTTP/1.1" 200 │
│ 2024-01-15 10:31:15 192.168.1.1 - - "GET /api HTTP/1.1" 404 │
│ 2024-01-15 10:32:00 192.168.1.2 - - "GET / HTTP/1.1" 200 │
│ │
└─────────────────────────────────────────────────────────────────┘

Log options

OptionDescription
Auto-refreshAutomatic update
TimestampsDisplay timestamps
LinesNumber of lines to display
WrapAutomatic line wrapping
DownloadDownload the logs
SearchSearch in the logs

4 - Console (Exec)

Access the terminal

┌─────────────────────────────────────────────────────────────────┐
│ 💻 Console - nginx [Connect] │
├─────────────────────────────────────────────────────────────────┤
│ Command: [/bin/sh ▼] │
│ User: [root ] │
├─────────────────────────────────────────────────────────────────┤
│ │
│ / # ls -la │
│ total 80 │
│ drwxr-xr-x 1 root root 4096 Jan 15 10:30 . │
│ drwxr-xr-x 1 root root 4096 Jan 15 10:30 .. │
│ drwxr-xr-x 2 root root 4096 Jan 10 00:00 bin │
│ drwxr-xr-x 5 root root 340 Jan 15 10:30 dev │
│ drwxr-xr-x 1 root root 4096 Jan 15 10:30 etc │
│ / # _ │
│ │
└─────────────────────────────────────────────────────────────────┘

Useful commands in the console

# Vérifier les processus
ps aux

# Voir la configuration
cat /etc/nginx/nginx.conf

# Tester la connectivité
ping google.com

# Voir les variables d'environnement
env

# Vérifier l'espace disque
df -h

5 - Real-time statistics

Stats dashboard

┌─────────────────────────────────────────────────────────────────┐
│ 📊 Stats - nginx │
├─────────────────────────────────────────────────────────────────┤
│ │
│ CPU Usage │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ ████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 2.5% │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
│ Memory Usage │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 35.2% │ │
│ │ 45.2 MB / 128 MB │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
│ Network I/O │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ ↓ 1.2 MB received ↑ 856 KB sent │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
│ Block I/O │
│ ┌─────────────────────────────────────────────────────────┐ │
│ │ Read: 4.5 MB Write: 1.2 MB │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Available metrics

MetricDescription
CPU %CPU usage
MemoryRAM used / limit
Network RXData received
Network TXData sent
Block ReadDisk read
Block WriteDisk write
PIDsNumber of processes

6 - Inspect a container

Detailed information

┌─────────────────────────────────────────────────────────────────┐
│ 🔍 Inspect - nginx │
├─────────────────────────────────────────────────────────────────┤
│ │
│ { │
│ "Id": "abc123def456...", │
│ "Created": "2024-01-15T10:30:00.000000000Z", │
│ "Path": "/docker-entrypoint.sh", │
│ "Args": ["nginx", "-g", "daemon off;"], │
│ "State": { │
│ "Status": "running", │
│ "Running": true, │
│ "StartedAt": "2024-01-15T10:30:05.000000000Z" │
│ }, │
│ "Image": "sha256:...", │
│ "NetworkSettings": { │
│ "IPAddress": "172.17.0.2", │
│ "Ports": { │
│ "80/tcp": [{"HostPort": "8080"}] │
│ } │
│ } │
│ } │
│ │
└─────────────────────────────────────────────────────────────────┘

7 - Duplicate/Edit

Modify a container

To modify an existing container:

  1. Select the container
  2. Click on Duplicate/Edit
  3. Modify the parameters
  4. Click on Deploy the container
┌─────────────────────────────────────────────────────────────────┐
│ Duplicate/Edit container: nginx │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ⚠️ This will stop and recreate the container │
│ │
│ Name: [nginx-v2 ] │
│ Image: [nginx:1.25-alpine ] (modified) │
│ │
│ Ports: │
│ [8080] → [80] │
│ [8443] → [443] (new) │
│ │
│ [Deploy the container] [Cancel] │
│ │
└─────────────────────────────────────────────────────────────────┘

8 - Bulk actions

Multiple selection

┌─────────────────────────────────────────────────────────────────┐
│ 📦 Containers │
├─────────────────────────────────────────────────────────────────┤
│ [Selected: 3] Actions: [Start] [Stop] [Kill] [Remove] │
├─────────────────────────────────────────────────────────────────┤
│ ☑ nginx 🟢 Running │
│ ☑ postgres 🟢 Running │
│ ☑ redis 🟢 Running │
│ □ old-app 🔴 Stopped │
│ │
└─────────────────────────────────────────────────────────────────┘

Filters

FilterOptions
StateRunning, Stopped, All
NameSearch by name
ImageFilter by image
NetworkFilter by network

9 - Best practices

Naming

# ✅ Bon
web-server
api-backend-prod
database-postgres-v15

# ❌ Mauvais
container1
test
abc

Resources

Always define limits:

Memory limit: 512 MB
CPU limit: 0.5

Restart policy

PolicyUse
NoTests
AlwaysCritical services
On-failureUnstable applications
Unless-stoppedStandard production

Summary

ActionHow
Create+ Add container
Start/StopAction buttons
LogsLogs tab
ConsoleConsole tab
StatsStats tab
ModifyDuplicate/Edit
RemoveRemove
Key points
  • The interface allows all CLI operations
  • Logs and the console make debugging easier
  • Stats enable real-time monitoring
  • Duplicate/Edit lets you modify without downtime

Practical exercises

  1. Create an nginx container with ports 8080:80
  2. Access the console and list the files
  3. Monitor the statistics during a load
  4. Modify the container to change the image

← User interface | Image management →