Skip to content

Commit

Permalink
schema
Browse files Browse the repository at this point in the history
  • Loading branch information
herveleclerc committed Sep 27, 2024
1 parent 29c4a8f commit b878eb3
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions labs/liascript/labs-docker-fundamentals.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,60 @@ process inside a container. The state of this process determines the liveness of
STDOUT and STDERR of this process is what’s logged by container logs, and this process’
response to SIGTERM determines how our container behaves during a controlled shutdown.
```

1. The Container Lifecycle


```
Created ---> Running ---> Stopped
^ | ^ |
| | | |
| v | v
+----- Paused | Removed
| ^
| |
+----------+
```

States and Transitions

1. **Created**
- Initial state after `docker create`
- Can transition to:
- Running (via `docker start`)
- Removed (via `docker rm`)

2. **Running**
- Container is executing
- Reached via `docker start` from Created or Stopped state
- Can transition to:
- Stopped (via `docker stop` or when process completes)
- Paused (via `docker pause`)

3. **Stopped**
- Container has been stopped
- Can transition to:
- Running (via `docker start`)
- Removed (via `docker rm`)

4. **Paused**
- Container execution is paused
- Can transition to:
- Running (via `docker unpause`)

5. **Removed**
- Container is deleted
- Final state, reached via `docker rm` from Created or Stopped state

Key Docker Commands

- `docker create`: Create a new container (Created state)
- `docker start`: Start a container (transition to Running)
- `docker stop`: Stop a running container (transition to Stopped)
- `docker pause`: Pause a running container (transition to Paused)
- `docker unpause`: Unpause a paused container (return to Running)
- `docker rm`: Remove a stopped or created container (transition to Removed)

## 2. Interactive Image Creation

By the end of this exercise, you should be able to:
Expand Down

0 comments on commit b878eb3

Please sign in to comment.