Skip to content

Commit 30aeb1a

Browse files
Mohammed NaserMohammed Naser
authored andcommitted
add Docker section and fix images problem
1 parent f563652 commit 30aeb1a

76 files changed

Lines changed: 201 additions & 91 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.obsidian/app.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
{}
1+
{
2+
"alwaysUpdateLinks": true
3+
}

.obsidian/workspace.json

Lines changed: 131 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,103 @@
1010
{
1111
"id": "b4feec1ef5f76a77",
1212
"type": "leaf",
13+
"state": {
14+
"type": "image",
15+
"state": {
16+
"file": "imgs/DevOps/Docker/about-dockerworking.jpg"
17+
},
18+
"icon": "lucide-image",
19+
"title": "about-dockerworking"
20+
}
21+
},
22+
{
23+
"id": "911d0de9456fa3ae",
24+
"type": "leaf",
25+
"state": {
26+
"type": "image",
27+
"state": {
28+
"file": "imgs/DevOps/Docker/Containers_VirtualMachines.png"
29+
},
30+
"icon": "lucide-image",
31+
"title": "Containers_VirtualMachines"
32+
}
33+
},
34+
{
35+
"id": "387cab2b02c292d0",
36+
"type": "leaf",
37+
"state": {
38+
"type": "image",
39+
"state": {
40+
"file": "imgs/DevOps/Docker/docker_future-e1468491725978.jpg"
41+
},
42+
"icon": "lucide-image",
43+
"title": "docker_future-e1468491725978"
44+
}
45+
},
46+
{
47+
"id": "aa4dbaa4c07ac27d",
48+
"type": "leaf",
49+
"state": {
50+
"type": "image",
51+
"state": {
52+
"file": "imgs/DevOps/Docker/meme.jpeg"
53+
},
54+
"icon": "lucide-image",
55+
"title": "meme"
56+
}
57+
},
58+
{
59+
"id": "39f808fb8e3166fa",
60+
"type": "leaf",
61+
"state": {
62+
"type": "image",
63+
"state": {
64+
"file": "imgs/DevOps/Docker/about-dockerworking.jpg"
65+
},
66+
"icon": "lucide-image",
67+
"title": "about-dockerworking"
68+
}
69+
},
70+
{
71+
"id": "f840e762a3d0bc90",
72+
"type": "leaf",
73+
"state": {
74+
"type": "image",
75+
"state": {
76+
"file": "imgs/DevOps/Docker/meme.jpeg"
77+
},
78+
"icon": "lucide-image",
79+
"title": "meme"
80+
}
81+
},
82+
{
83+
"id": "9c4ee19e7ac7cce9",
84+
"type": "leaf",
85+
"state": {
86+
"type": "image",
87+
"state": {
88+
"file": "imgs/DevOps/Docker/docker-user-defined-bridge-network.png"
89+
},
90+
"icon": "lucide-image",
91+
"title": "docker-user-defined-bridge-network"
92+
}
93+
},
94+
{
95+
"id": "04d2e7d5bd69e07f",
96+
"type": "leaf",
1397
"state": {
1498
"type": "markdown",
1599
"state": {
16-
"file": "index.md",
100+
"file": "Linux-advanced-topics/Editors/vim/index.md",
17101
"mode": "source",
18102
"source": false
19103
},
20104
"icon": "lucide-file",
21105
"title": "index"
22106
}
23107
}
24-
]
108+
],
109+
"currentTab": 7
25110
}
26111
],
27112
"direction": "vertical"
@@ -183,32 +268,51 @@
183268
"bases:Create new base": false
184269
}
185270
},
186-
"active": "b4feec1ef5f76a77",
271+
"active": "4c6cb873c8c20e53",
187272
"lastOpenFiles": [
188-
"file.jpeg",
189-
"contrbuite.md",
190-
"Tools/README.md",
191-
"Linux-Basics/Dealing with Users & Groups/README.md",
192-
"How to install/README.md",
193-
"How to install/index.md",
194-
"Git & githuhb/github/Readme.md",
195-
"Git & githuhb/git/hands-on/Readme.md",
196-
"Common issues & its fixes/README.md",
197-
"DevOps/README.md",
273+
"Linux-advanced-topics/Editors/README.md",
274+
"Linux-Basics/Text Processing/Awk/README.md",
275+
"Linux-advanced-topics/Editors/nano/README.md",
276+
"imgs/Editors/nano/cheat-sheet.png",
277+
"imgs/Editors/nano/Jump-to-line-X.png",
278+
"imgs/Editors/nano",
279+
"Linux-Basics/Files Permissions & Ownership/README.md",
280+
"Linux-Basics/File Globbing/README.md",
281+
"Linux-Basics/Linux Desktop/README.md",
282+
"Linux-Basics/Introduction to Linux/README.md",
283+
"Linux-advanced-topics/Editors/vim/index.md",
284+
"imgs/Editors/VIM/intro-screen.png",
285+
"imgs/Editors/VIM",
286+
"imgs/Editors",
287+
"DevOps/Docker/what-is-docker.md",
288+
"Linux-Basics/Creating Links/README.md",
289+
"imgs/creating-links/showing_inodes.png",
290+
"Linux-advanced-topics/Networking/imgs/asymmetric-example.png",
291+
"imgs/DevOps/Docker/about-dockerworking.jpg",
292+
"imgs/DevOps/Docker/docker-user-defined-bridge-network.png",
293+
"imgs/DevOps/Docker/Docker-Registry.png",
294+
"imgs/DevOps/Docker/docker-file-example.png",
295+
"imgs/DevOps/Docker/docker-environment-variables.png",
296+
"DevOps/Docker/arch-linux-installation.md",
198297
"index.md",
199-
"Linux-Basics/CLI & Linux File System/README.md",
200-
"Linux-Basics/CLI & Linux File System/Terminal-Types.md",
201-
"Linux-Basics/CLI & Linux File System/imgs/example_absolute_and_relative_path.png",
202-
"Linux-Basics/CLI & Linux File System/imgs/Continuing-a-long-command-on-another-line.png",
203-
"Linux-Basics/CLI & Linux File System/imgs/Command-history.png",
204-
"Linux-Basics/CLI & Linux File System/imgs/command_line_syntax.jpg",
205-
"Linux-Basics/CLI & Linux File System/imgs/command_line_prompt.jpg",
206-
"Linux-Basics/CLI & Linux File System/imgs/cd.jpg",
207-
"manifesto.md",
208-
"Linux advanced topics/Editors/nano/README.md",
209-
"Linux-Basics/README.md",
210-
"Linux-Basics/Boot Process/README.md",
211-
"Linux-Basics/Boot Process/imgs/bootProcess.jpeg",
212-
"Linux-Basics/Boot Process/imgs/bootloader.jpg"
298+
"imgs/DevOps/Docker",
299+
"imgs/DevOps",
300+
"DevOps/Docker/dockerize-some-apps-on-github.md",
301+
"DevOps/Docker/docker-networking.md",
302+
"DevOps/Docker/docker-nginx-mongodb-nodejs.md",
303+
"DevOps/Docker/docker-file.md",
304+
"DevOps/Docker/docker-mongodb-nodejs.md",
305+
"DevOps/Docker/docker-hot-reload.md",
306+
"DevOps/Docker/docker-environment-variables.md",
307+
"DevOps/README.md",
308+
"DevOps/Docker/trafficlight-docker-challenge-solution.md",
309+
"DevOps/Docker/index.md",
310+
"DevOps/Docker/imgs",
311+
"DevOps/Docker/docker-volumes.md",
312+
"DevOps/Docker/docker-swarm.md",
313+
"DevOps/Docker/docker-push-to-docker-hub.md",
314+
"DevOps/Docker/docker-orchestration.md",
315+
"DevOps/Docker/Docker/imgs",
316+
"DevOps/Docker/Docker"
213317
]
214318
}

DevOps/Docker/docker-compose.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ services: # List of services to run.
5555
- /app/node_modules # Mounts the /app/node_modules directory in the container. (Anonymous volume)
5656
```
5757
58-
![docker-compose](./imgs/docker-compose-example.png)
58+
![docker-compose](/imgs/DevOps/Docker/docker-compose-example.png)
5959
6060
Notice that the name of the image is `nodeapp-express-node-app`. This is because the `build` key in the `docker-compose.yml` file uses the current directory name with the service name to name the image.
6161

DevOps/Docker/docker-environment-variables.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ docker run -e NODE_ENV=production -e DB_URL=mongodb://localhost:27017/mydb my-im
6262
```bash
6363
docker run --name express-node-app-container -v "$(pwd)":/app -v /app/node_modules --env PORT=4000 --env NODE_ENV=development -d -p 4000:4000 express-node-app
6464
```
65-
![Example](./imgs/docker-environment-variables.png)
65+
![Example](/imgs/DevOps/Docker/docker-environment-variables.png)
6666

6767
In the above example, we are passing the `PORT` and `NODE_ENV` environment variables to the `express-node-app` container.
6868

@@ -100,7 +100,7 @@ docker run --env-file .env my-image
100100
docker run --name express-node-app-container -v "$(pwd)":/app -v /app/node_modules --env-file .env -d -p 4000:4000 express-node-app
101101
```
102102

103-
![Example](./imgs/docker-environment-variables-file.png)
103+
![Example](/imgs/DevOps/Docker/docker-environment-variables-file.png)
104104

105105
-------------------------
106106

@@ -125,7 +125,7 @@ services:
125125
126126
In this example, the `environment` section is used to set the `PORT` and `NODE_ENV` environment variables for the `express-node-app` service.
127127

128-
![Example](./imgs/docker-environment-variables-compose.png)
128+
![Example](/imgs/DevOps/Docker/docker-environment-variables-compose.png)
129129

130130
You can also use an environment file in Docker Compose by specifying the `env_file` option:
131131

@@ -142,7 +142,7 @@ services:
142142
env_file:
143143
- .env
144144
```
145-
![Example](./imgs/docker-environment-variables-compose-file.png)
145+
![Example](/imgs/DevOps/Docker/docker-environment-variables-compose-file.png)
146146

147147
In this example, the `.env` file is used to set the environment variables for the `express-node-app` service.
148148

DevOps/Docker/docker-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ CMD ["npm", "start"]
100100
101101
- `npm install` installs all the dependencies listed in the `package.json` file. If the `package.json` file has not changed since the last build, Docker will use the cached layer for that step and not execute the `npm install` command again. This speeds up the build process.
102102
103-
![Docker Cache Mechanism](./imgs/docker-cache-mechanism.png)
103+
![Docker Cache Mechanism](/imgs/DevOps/Docker/docker-cache-mechanism.png)
104104
105105
------------------------------------------------------------
106106

DevOps/Docker/docker-hot-reload.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Notice that `-v` must be followed by the **absolute path** of the directory on t
4343

4444
When you use the `-v` flag to mount a local directory into the container, it overrides the content of the container's directory with the content from your local directory. This means that even if files are ignored during the build process, they will still appear in the container if they exist in the mounted directory.
4545

46-
![Hot Reload](./imgs/hot-reload.png)
46+
![Hot Reload](/imgs/DevOps/Docker/hot-reload.png)
4747

4848
--------------------------------------------
4949

DevOps/Docker/docker-networking.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Before we explore Docker Networking in depth, let’s clarify some foundational
1212
- App inside Docker container runs in an isolated docker network.
1313
- To access the app from outside the container, we need to map the container port to the host port which is called **port binding**.
1414

15-
![Container Port vs Host Port](imgs/container-port-vs-host-port.png)
15+
![Container Port vs Host Port](/imgs/DevOps/Docker/container-port-vs-host-port.png)
1616

1717
## Port Binding
1818

@@ -48,7 +48,7 @@ Before we explore Docker Networking in depth, let’s clarify some foundational
4848

4949
- It can communicate with all containers using **their IP addresses**.
5050

51-
![Docker Host](imgs/docker-host.png)
51+
![Docker Host](/imgs/DevOps/Docker/docker-host.png)
5252

5353
------------------
5454

@@ -62,7 +62,7 @@ Docker networks configure how containers communicate both with each other and wi
6262

6363
- Port mapping does not take effect when using the none network driver. `-p` option is ignored. The container is isolated from the network and cannot communicate with the host machine or other containers.
6464

65-
![None Network Driver](imgs/docker-none-network.png)
65+
![None Network Driver](/imgs/DevOps/Docker/docker-none-network.png)
6666

6767
## Bridge Network Driver (Default)
6868

@@ -87,7 +87,7 @@ Docker networks configure how containers communicate both with each other and wi
8787
- Here is how the default bridge network looks like:
8888
- At start up, Docker engine finds an unused network subnet on the docker host (normally 172.17.0.0/16), and assigns the first IP address of that network (normally 172.17.0.1) to the default bridge - docker0.
8989
- When you start a container, Docker assigns an IP address from the subnet to the container. The container can communicate with other containers on the same bridge network using this IP address.
90-
![Bridge Network Driver](imgs/docker-bridge-network-1.png)
90+
![Bridge Network Driver](/imgs/DevOps/Docker/docker-bridge-network-1.png)
9191

9292
### veth Interfaces in Bridge Networks
9393

@@ -126,7 +126,7 @@ dockerhost$ docker exec web ip addr show
126126
inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0
127127
```
128128

129-
![veth interfaces](imgs/docker-bridge-network-veth-1.png)
129+
![veth interfaces](/imgs/DevOps/Docker/docker-bridge-network-veth-1.png)
130130

131131
### Notes
132132

@@ -142,7 +142,7 @@ dockerhost$ docker exec web ip addr show
142142
- It has certain advantages most importantly, **service discovery.** Containers on the same user-defined bridge network can communicate with each other using their container names. This is because Docker provides a built-in DNS server that resolves container names to their IP addresses. This makes it easier to connect containers together without having to know their IP addresses.
143143
> In the default bridge network, you have to use IP addresses to communicate between containers. There is no service discovery since there is no DNS server.
144144
145-
![User-defined Bridge Network](imgs/docker-user-defined-bridge-network.png)
145+
![User-defined Bridge Network](/imgs/DevOps/Docker/docker-user-defined-bridge-network.png)
146146

147147
## Compose-Defined Bridge Network
148148

@@ -166,7 +166,7 @@ dockerhost$ docker exec web ip addr show
166166
- No IP address is allocated to the container, it shares it with the host.
167167
- Port-mapping does not take effect. “-p”, and “-P” options are ignored. Whatever the port of the application inside the container, it is available as-is on the host’s IP address.
168168

169-
![Host Network Driver](imgs/docker-host-network.png)
169+
![Host Network Driver](/imgs/DevOps/Docker/docker-host-network.png)
170170

171171
## Overlay Network Driver (Multi-Host Networking)
172172

DevOps/Docker/docker-swarm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ Docker Swarm works on a master-slave architecture. The master node is responsibl
2626

2727
Worker nodes are responsible for running the containers. They receive tasks from the manager node and execute them.
2828

29-
![Docker Swarm Architecture](./imgs/docker-swarm-architecture.png)
29+
![Docker Swarm Architecture](/imgs/DevOps/Docker/docker-swarm-architecture.png)
3030

3131
--------------------

DevOps/Docker/dockerize-some-apps-on-github.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: "Dockerize some apps on Github"
3-
author: "Salma Ayman"
2+
title: Docker
3+
author: Salma Ayman
44
---
55

66
I will pick some random apps from Github and Dockerize them. This will help me gain more experience with Docker and also learn how to Dockerize different types of applications.

DevOps/Docker/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ author: "Salma Ayman"
55

66
My learning diary for Docker.
77

8-
![meme](./imgs/docker_future-e1468491725978.jpg)
8+
![meme](docker_future-e1468491725978.jpg)
99

1010
## Before you start
1111

12-
- **Linux Users**: Installing Docker is a breeze with your package manager. If you’re an Arch Linux user like me, check out my guide to [installing Docker on Arch Linux](arch-linux-installation.md).
12+
- **Linux Users**: Installing Docker is a breeze with your package manager. If you’re an Arch Linux user like me, check out my guide to [installing Docker on Arch Linux](/imgs/DevOps/Docker/arch-linux-installation.md).
1313

1414
- **Windows Users**: Oh, Windows users, bless your hearts. If only you could **switch to Linux** and save yourself some hassle!
1515

@@ -48,7 +48,7 @@ My learning diary for Docker.
4848

4949
- [Sysadmin with Docker](https://hamk-sysadmin-docker.github.io/exercises/):This is also a good resource to practice Docker.
5050

51-
![meme](./imgs/meme.jpeg)
51+
![meme](/imgs/DevOps/Docker/meme.jpeg)
5252

5353
## References
5454

0 commit comments

Comments
 (0)