कैसे इस्तेमाल करें
- बाईं ओर docker run commands paste करें। Backslash वाली multi-line commands चलती हैं; कई commands new lines, semicolons या && से अलग करें।
- दाईं ओर Compose file दिखेगी। हर command --name के नाम से या image के नाम से service बनती है।
- Yellow note में unconverted items जाँचें, फिर compose.yaml copy/download करके docker compose up -d चलाएँ।
विकल्पों की जानकारी
- Supported flags
- -p, -v, --mount, -e, --env-file, --name, --restart, --network, -w, -u, -h, --entrypoint, -l, --add-host, --dns, --cap-add/drop, --device, -m, --cpus, --shm-size, --ulimit, --log-driver/--log-opt और --health-* आदि।
- Named volumes और networks
- pgdata:/data जैसे named volumes top-level volumes में घोषित होते हैं। Custom networks external true के साथ घोषित होते हैं; host और none networks network_mode बनते हैं।
- Ports
- Port mappings हमेशा quoted रहती हैं। YAML 1.1 में 22:22 base-60 number पढ़ा जा सकता है, इसलिए Docker docs ports को strings रखने कहते हैं।
- Ignored flags
- -d और --rm का Compose equivalent नहीं, इसलिए हटते हैं। --gpus जैसी unsupported flags note में रहती हैं।
उदाहरण
docker run -d --name web --restart unless-stopped -p 8080:80 \
-v ./html:/usr/share/nginx/html:ro -e TZ=Asia/Shanghai --memory 512m nginx:1.27
इससे यह बनता है:
services:
web:
image: nginx:1.27
container_name: web
restart: unless-stopped
mem_limit: 512m
ports:
- "8080:80"
environment:
- TZ=Asia/Shanghai
volumes:
- ./html:/usr/share/nginx/html:ro
अक्सर पूछे जाने वाले सवाल
क्या file में version line चाहिए?
नहीं। Current Docker Compose v2 top-level version field उपयोग नहीं करता; होने पर warning के साथ ignore करता है।
क्या environment variables के passwords upload होते हैं?
नहीं। Parsing और conversion ब्राउज़र में होती है और कुछ भी server को नहीं भेजा जाता।
क्या quoted arguments संभलते हैं?
हाँ। Single quotes, double quotes और backslash escapes shell rules follow करते हैं, इसलिए -e "MSG=hello world" पूरी value रखता है।
प्राइवेसी
यह टूल पूरी तरह आपके ब्राउज़र में चलता है। आपकी फ़ाइलें और टेक्स्ट आपके डिवाइस पर ही प्रोसेस होते हैं और हमारे सर्वर पर कभी अपलोड नहीं होते।