Skip to content

Commit bdee091

Browse files
authored
Update lab2-working-with-images.md
1 parent cc90343 commit bdee091

File tree

1 file changed

+1
-58
lines changed

1 file changed

+1
-58
lines changed

lab2-working-with-images.md

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -42,68 +42,11 @@ Identify unused images and clean up the system using:
4242
docker system prune
4343
```
4444

45-
---
46-
47-
### **Lab 2: Working with Containers**
48-
49-
#### **Objective:**
50-
Understand how to start, list, interact with, and manage Docker containers.
51-
52-
#### **Tasks:**
53-
54-
**Starting a Container:**
55-
Run a container using the **Ubuntu** image in interactive mode:
56-
```bash
57-
docker run -it ubuntu
58-
```
59-
Inside the container, run the command:
60-
```bash
61-
echo "Hello from Ubuntu!"
62-
```
63-
Exit the container by typing `exit`.
64-
65-
**Listing Containers:**
66-
View running containers:
67-
```bash
68-
docker ps
69-
```
70-
View all containers (including stopped ones):
71-
```bash
72-
docker ps -a
73-
```
7445

75-
**Stopping and Removing Containers:**
76-
Start a new **Alpine** container:
77-
```bash
78-
docker run -d --name my-alpine alpine sleep 300
79-
```
80-
Stop the container:
81-
```bash
82-
docker stop my-alpine
83-
```
84-
Remove the container:
85-
```bash
86-
docker rm my-alpine
87-
```
88-
89-
**Interactive Mode:**
90-
Run a new **nginx** container in detached mode:
91-
```bash
92-
docker run -d --name my-nginx nginx
93-
```
94-
Attach to the running container:
95-
```bash
96-
docker exec -it my-nginx bash
97-
```
98-
Run the command:
99-
```bash
100-
ls /usr/share/nginx/html
101-
```
102-
Exit the container's shell by typing `exit`.
10346

10447
---
10548

106-
### **Lab 3: Combining Image and Container Management**
49+
### Combining Image and Container Management**
10750

10851
#### **Objective:**
10952
Learn how to combine image and container operations to create a workflow.

0 commit comments

Comments
 (0)