-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Docker #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Docker #523
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| ### Task 1: Introduction and Conceptual Understanding | ||
| 1. **Write an Introduction:** | ||
| - In your `solution.md`, provide a brief explanation of Docker’s purpose in modern DevOps. | ||
| - Compare **Virtualization vs. Containerization** and explain why containerization is the preferred approach for microservices and CI/CD pipelines. | ||
|
|
||
|
|
||
| ### Introduction to Docker | ||
|
|
||
| Docker is an OS‑level virtualization (or containerization) platform, which allows applications to share the host OS kernel instead of running a separate guest OS like in traditional virtualization. This design makes Docker containers lightweight, fast, and portable, while keeping them isolated from one another. | ||
|
|
||
| ** Containers vs. virtualization ** | ||
| Containers are an abstraction that packages application code and dependencies together. Instances of the container can then be created, started, stopped, moved, or deleted using the Docker API or command-line interface (CLI). Containers can be connected to one or more networks, be attached to storage, or create new images based on their current states. | ||
|
|
||
| Containers differ from virtual machines, which use a software abstraction layer on top of computer hardware, allowing the hardware to be shared more efficiently in multiple instances that will run individual applications. Docker containers require fewer physical hardware resources than virtual machines, and they also offer faster startup times and lower overhead. This makes Docker ideal for high-velocity environments, where rapid software development cycles and scalability are crucial. | ||
|
|
||
|  | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if the referenced image exists
if [ -f "2025/docker/image-1.png" ]; then
echo "Image found at 2025/docker/image-1.png"
else
echo "ERROR: image-1.png not found at 2025/docker/image-1.png"
echo "Searching for any png files in 2025/docker/ directory..."
fd -e png . 2025/docker/ 2>/dev/null || echo "No files found or directory does not exist"
echo ""
echo "Checking if 2025/docker directory exists..."
ls -la 2025/docker/ 2>/dev/null || echo "Directory 2025/docker/ does not exist"
fiRepository: LondheShubham153/90DaysOfDevOps Length of output: 558 🏁 Script executed: cat -n 2025/docker/task1_sol.mdRepository: LondheShubham153/90DaysOfDevOps Length of output: 2069 Missing referenced image file. The documentation references Add the image file to 🤖 Prompt for AI Agents |
||
|
|
||
| Containerization is the preferred approach for microservices and CI/CD pipelines because it offers crucial benefits such as isolation, consistency, and portability. These benefits streamline development, testing, and deployment, making the entire process faster and more reliable. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from flask import Flask | ||
| app = Flask(__name__) | ||
|
|
||
| @app.route('/') | ||
| def hello_world(): | ||
| return 'Hello, World!' | ||
|
|
||
| if __name__ == '__main__': | ||
| app.run(host='0.0.0.0', port=5000) | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Flask |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ### Task 2: Create a Dockerfile for a Sample Project | ||
| 1. **Select or Create a Sample Application:** | ||
| - Choose a simple application (for example, a basic Node.js, Python, or Java app that prints “Hello, Docker!” or serves a simple web page). | ||
|
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Task 2 solution documentation is incomplete. This file only contains the header and first bullet point but lacks the actual solution content. For a complete educational resource, it should include:
Would you like me to help generate complete solution documentation for this task? 🔎 Example content that should be added### Task 2: Create a Dockerfile for a Sample Project
1. **Select or Create a Sample Application:**
- Choose a simple application (for example, a basic Node.js, Python, or Java app that prints "Hello, Docker!" or serves a simple web page).
2. **Create a Dockerfile:**
- In the same directory as your application, create a file named `Dockerfile`
```dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
EXPOSE 5000
CMD ["python", "app.py"]
In 2025/docker/task2/task2_sol.md around lines 1 to 3, the Task 2 solution is |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| Task: | ||
| Create a user devops_user and add them to a group devops_team. | ||
|
|
||
| # useradd devops_user | ||
| # groupadd devops_team | ||
| # gpasswd -a devops_user devops_team | ||
|
|
||
| Set a password and grant sudo access. | ||
| # sudo passwd devops_user | ||
|
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing sudo access grant commands. The task mentions granting sudo access, but the actual implementation is missing. The 🔎 Proposed additionAdd the following after setting the password: # Grant sudo access by adding user to sudo group
sudo usermod -aG sudo devops_user
# OR add specific sudoers entry
echo "devops_user ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/devops_user🤖 Prompt for AI Agents |
||
|
|
||
| Restrict SSH login for certain users in /etc/ssh/sshd_config. | ||
| # cd /etc/ssh | ||
| # vi sshd_config | ||
| # add a keyword AllowAccess | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect SSH configuration keyword. The keyword Example correct usage: AllowUsers devops_user adminor DenyUsers guest test🤖 Prompt for AI Agents |
||
| */ | ||
|
Comment on lines
+1
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix incorrect comment syntax for Markdown. This file uses C-style comment syntax ( 🔎 Proposed fix-/*
Task:
Create a user devops_user and add them to a group devops_team.
# useradd devops_user
# groupadd devops_team
# gpasswd -a devops_user devops_team
Set a password and grant sudo access.
# sudo passwd devops_user
Restrict SSH login for certain users in /etc/ssh/sshd_config.
# cd /etc/ssh
# vi sshd_config
# add a keyword AllowAccess
-*/
+## Task:
+Create a user devops_user and add them to a group devops_team.
+
+```bash
+# useradd devops_user
+# groupadd devops_team
+# gpasswd -a devops_user devops_team
+```
+
+Set a password and grant sudo access.
+```bash
+# sudo passwd devops_user
+```
+
+Restrict SSH login for certain users in /etc/ssh/sshd_config.
+```bash
+# cd /etc/ssh
+# vi sshd_config
+# add a keyword AllowUsers or DenyUsers
+```🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix spacing in emphasis markers.
As per coding guidelines from static analysis, remove the spaces inside the emphasis markers for proper Markdown formatting.
🔎 Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
11-11: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
11-11: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
🤖 Prompt for AI Agents