Update Info.md

This commit is contained in:
RadinPirouz
2024-03-29 13:27:20 +03:30
committed by GitHub
parent 7b4eb86a23
commit 413f0399ba

View File

@@ -1,40 +1,27 @@
## Docker: یک مقدمه جامع # Docker Information
### 1. چیستی Docker؟ ## What is Docker?
داکر یک پلتفرم متن‌باز است که به شما این امکان را می‌دهد تا برنامه‌ها را در محیط‌های کانتینری اجرا کنید. کانتینرها محیط‌های عایق شده‌ای هستند که شامل برنامه، کتابخانه‌ها، و تنظیمات مورد نیاز برای اجرای یک برنامه خاص هستند. Docker این امکان را به شما می‌دهد تا برنامه‌های خود را در هر سیستم عاملی اجرا کنید بدون نگرانی از تفاوت‌های محیط. [Docker](https://www.docker.com/) is a platform for developing, shipping, and running applications in containers. Containers are lightweight, portable, and self-sufficient environments that contain everything needed to run an application, including the code, runtime, libraries, and dependencies. Docker provides a way to package and distribute applications as containers, allowing them to run consistently across different environments.
### 2. نصب Docker ## Key Concepts
برای نصب Docker، به [سایت رسمی Docker](https://www.docker.com/) مراجعه کنید و نسخه مناسب برای سیستم عامل خود را دانلود و نصب کنید. ### Images
### 3. دستورات اولیه An image is a read-only template used to create containers. It contains the application code, runtime, libraries, and dependencies needed to run the application. Images are built using a Dockerfile, which specifies the instructions for creating the image.
- `docker --version`: نمایش نسخه Docker. ### Containers
- `docker pull image_name:tag`: دانلود یک تصویر از Docker Hub.
- `docker images`: نمایش تصاویر دانلود شده.
- `docker ps`: لیست کانتینرهای در حال اجرا.
- `docker ps -a`: نمایش تمام کانتینرها (شامل کانتینرهای متوقف شده).
- `docker run image_name:tag`: اجرای یک کانتینر از تصویر.
### 4. ساخت یک Dockerfile A container is a runnable instance of an image. It encapsulates the application and its dependencies, providing isolation from the host system and other containers. Containers are lightweight, portable, and can be easily moved between different environments.
Dockerfile یک فایل متنی است که توسط Docker برای ساخت تصویر از برنامه‌های شما استفاده می‌شود. به عنوان مثال: ### Dockerfile
```Dockerfile A Dockerfile is a text file that contains the instructions for building a Docker image. It specifies the base image, environment variables, dependencies, and commands needed to set up the application environment. Dockerfiles allow developers to automate the process of building images and ensure consistency across environments.
# استفاده از تصویر پایه
FROM ubuntu:latest
# اضافه کردن و اجرای دستورات ### Docker Hub
RUN apt-get update && apt-get install -y python3
# تنظیم دستور پیش‌فرض برای اجرا [Docker Hub](https://hub.docker.com/) is a cloud-based registry service that hosts Docker images. It provides a centralized repository for sharing, storing, and managing Docker images. Docker Hub allows developers to pull pre-built images from public repositories or publish their own images for others to use.
CMD ["python3", "--version"]
```
### 5. ساخت و اجرای تصویر ## Conclusion
- `docker build -t custom_image .`: ساخت تصویر از Dockerfile فعلی. Docker simplifies the process of developing, shipping, and running applications by providing a consistent environment across different platforms. It enables developers to package applications as containers, making them portable, scalable, and easy to deploy. With its rich ecosystem of tools and services, Docker has become a key technology in modern software development workflows.
- `docker run custom_image`: اجرای کانتینر از تصویر سفارشی.
این توضیحات ابتدایی راهنمایی‌های اولیه‌ای برای شروع با Docker فراهم کرده‌اند. برای یادگیری بیشتر، مستندات Docker را [اینجا](https://docs.docker.com/) بررسی کنید.