Dagger Shell - कंटेनर युग के लिए एक नया shell
(dagger.io)- Unix shell का उपयोग 50 साल से भी अधिक समय से किया जा रहा है, और यह सरल commands के साथ जटिल operations को जोड़ने वाला एक शक्तिशाली computing tool रहा है
- लेकिन आधुनिक software stack कहीं अधिक जटिल हो चुका है, और पारंपरिक shell से इन सभी कार्यों को संभालना कठिन है
- Docker, make, powershell, nix आदि से प्रेरित होकर, एक ऐसे modern shell की ज़रूरत बनी जो container, secret, service endpoint, declarative execution, cache और sandboxing जैसी चीज़ों को built-in support दे
- Dagger Shell Dagger Engine के लिए bash syntax-आधारित frontend है, जिसे build, test, deploy, temporary environment जैसी कई automation tasks में उपयोग किया जा सकता है
- यह system shell को replace करने के बजाय उसे complement करने वाला tool है, जो complex workflow को simple module combinations के ज़रिए बनाने में मदद करता है
container | from alpine | with-exec apk add git | terminal -
shell और code ही काफ़ी हैं
- complex scripts को संभालते समय किसी अजीब DSL को सीखने के बजाय, आप असली programming language में लिख सकते हैं
- Go, Python, Typescript, Java, PHP आदि कई languages के लिए SDK उपलब्ध हैं
- language में लिखे गए functions को Dagger के नए primitives के रूप में extend किया जा सकता है
-
API से जुड़ा shell
- Dagger Shell, Dagger API client की तरह काम करता है, और typed objects, documentation, तथा reusable module ecosystem (Daggerverse) तक पहुँच देता है
- उदाहरण के लिए, Trivy security scanning module को load करके चलाया जा सकता है
-
default sandbox environment
- सभी commands डिफ़ॉल्ट रूप से sandbox में चलती हैं, और files, secrets, services आदि तक access स्पष्ट रूप से specify करना पड़ता है। यह थोड़ा अधिक verbose है, लेकिन reproducibility और safety बढ़ाता है
container | from alpine | with-secret-variable POSTGRES_PASSWORD op://dev/db-password/credential | with-directory /src ~/src/myapp | with-service-binding db tcp://localhost:5432 | terminal
- सभी commands डिफ़ॉल्ट रूप से sandbox में चलती हैं, और files, secrets, services आदि तक access स्पष्ट रूप से specify करना पड़ता है। यह थोड़ा अधिक verbose है, लेकिन reproducibility और safety बढ़ाता है
-
simple container build
- Alpine-आधारित container बनाना, text file insert करना, message output set करना, और temporary registry में push करना—ये सब एक साथ किया जा सकता है
- Dockerfile लिखने, build command चलाने और push के बीच context switching किए बिना काम हो जाता है
# Build a wolfi linux container with curl, then test connection to stable and dev docs github.com/dagger/dagger/modules/wolfi | container --packages=curl | with-service-binding docs-stable $(github.com/dagger/dagger/docs@v0.17.1 | server) | with-service-binding docs-dev $(github.com/dagger/dagger/docs@main | server) | with-exec curl http://docs-stable | with-exec curl http://docs-dev
-
test environment setup
- CI में अक्सर आने वाली test environment setup की समस्या को भी आसानी से संभाला जा सकता है
- native service binding support की मदद से कई live instances को जोड़कर test किया जा सकता है
repo=$(git https://github.com/dagger/hello-dagger | head | tree) env=$(container | from node:23 | with-directory /app $repo | with-workdir /app) build=$($env | with-exec npm install | with-exec npm run build | directory ./dist) container | from nginx | with-directory /usr/share/nginx/html $build | terminal --cmd=/bin/bash
-
multi-stage build
- स्पष्ट और modular syntax के साथ complex build pipeline लागू की जा सकती है
- हर stage को variable के रूप में स्पष्ट करने से debugging और reuse आसान हो जाता है
container | from golang:latest | with-directory /src $(git https://github.com/dagger/dagger | head | tree) | with-workdir /src | with-exec go build ./cmd/dagger | file ./dagger | export ./dagger
2 टिप्पणियां
जानकारी के लिए, लिंक बदलकर https://dagger.io/blog/… हो गया है
Hacker News टिप्पणियाँ
आजकल Dagger का असली उपयोग समझना लगातार मुश्किल होता जा रहा है
Dockerfile और shell scripts को मिलाकर अलग-अलग images बनानी पड़ती हैं
यह बात छूट गई थी कि Dagger Docker को replace करने की कोशिश कर रहा है
Dagger Shell scripts को notebook फ़ॉर्मैट में लिखने के लिए एक web UI पहले से बना हुआ है
Dagger की homepage description देखकर जिज्ञासा हुई
संबंधित self-promotion
क्या इसका उद्देश्य container के अंदर development work करना है?
साफ़ तौर पर, इस tool से क्या किया जा सकता है?
पहली नज़र में यह Dockerfile और असली code से software को define और configure करने के बीच का एक मध्य चरण लगता है
क्या Dagger ने product direction बदल दी है?