🚀 Reduced Python Docker Image Size using Distroless Recently, I worked on optimizing a Python web application Docker image and managed to significantly reduce the image size by using a Distroless image. Instead of shipping a full Linux distribution (shell, package manager, OS utilities), I switched to a Distroless runtime, which contains only the Python runtime and required libraries. ✅ What I did: Used multi‑stage Docker builds Built dependencies in an Alpine/Python build stage Copied only the runtime artifacts into a Distroless Python image Which contains no: Shell (bash/sh) Package managers (apt/apk) Build tools and OS utilities ✅ Result: 📉 Much smaller image size 🔒 Reduced attack surface ⚡ Faster startup time ✅ Production‑ready container This is a great approach for: Python web apps (FastAPI / Flask / Django) Kubernetes deployments Security‑focused and performance‑critical environments Distroless images are not ideal for debugging, but for stable production workloads, they are a huge win. Always happy to learn and optimize further 🚀 #Docker #Python #DevOps #Containers #Distroless #CloudNative #FastAPI #Kubernetes #Learning
Optimizing Python Docker Image with Distroless
More Relevant Posts
-
Canonical's article highlights the evolution of Ubuntu's toolchains, detailing improvements in developer experiences through updated GCC, LLVM, and Python, alongside new workflow options. I found it interesting that the introduction of task-focused devpacks and FIPS compliant toolchains demonstrates a commitment to not just functionality, but also security and ease of use for developers. What advancements in toolchains do you think will have the biggest impact on development in the future?
To view or add a comment, sign in
-
The evolution of Ubuntu’s toolchains highlights significant advancements in developer experience through updated GCC, LLVM, and Python, along with new task-focused devpacks. I found it interesting that Canonical is focusing not only on traditional toolchains but also on innovations like opinionated openJDK variants. What do you think are the most essential features for modern development toolchains?
To view or add a comment, sign in
-
Django Commands Every Beginner Should Know When starting with Django, remembering all the commands can feel confusing. So I created a simple cheat sheet of commonly used Django commands to make things easier. This can help you: • set up a project quickly. • run your server. • manage apps and migrations. • work more efficiently while building projects. If you're learning Django, these commands will be useful in your daily workflow. Comment Down, Which Django command do you use the most? 📌I share simple Python and backend learnings here. #Django #Python #WebDevelopment #Backend #Programming #LearnToCode #SoftwareEngineering #PythonDeveloper
To view or add a comment, sign in
-
😊❤️ Todays topic: Topic: Virtual Environment (venv) in Python ============== When working on multiple Python projects, each project may need different versions of libraries. A virtual environment helps you manage this cleanly. Problem: Project A needs: Django 3.2 Project B needs: Django 4.0 If you install both globally, they will conflict. Solution: Virtual Environment A virtual environment creates an isolated space for each project. Each project can have its own: Python packages Versions Dependencies Create virtual environment: python -m venv myenv Activate environment: Windows: myenv\Scripts\activate Mac/Linux: source myenv/bin/activate Install packages inside environment: pip install django Deactivate environment: deactivate Key Points: Isolates project dependencies Prevents version conflicts Makes projects portable Interview Insight: Always use virtual environments in real projects to ensure consistent setup across different systems. Quick Question: What will happen if you install a package without activating the virtual environment? #Python #Programming #Coding #InterviewPreparation #Developers
To view or add a comment, sign in
-
Tired of Python package chaos after you think your automation is done? In my latest post, "Ansible Pip 2026: Install, Manage Packages, and Avoid Common Mistakes," I walk through how to reliably install and manage Python packages with Ansible so you stop chasing manual installs and environment drift. Key takeaways: - When to use ansible.builtin.pip vs. system package managers - Best practices for virtualenvs, user installs, and idempotency - How to avoid common pitfalls that introduce drift and security issues - Examples and playbook snippets you can apply today If you manage deployments or write Ansible roles, this will save you time and reduce incidents. Read the full article and try the playbook examples in your CI/CD pipeline. Read it now and share what mistakes you still see in the wild — I’ll respond to questions and examples. #Ansible #DevOps #Python
To view or add a comment, sign in
-
📅 Week 1 of sharing my backend journey Here’s what I covered 👇 ✔ Django vs Flask (when to use what) ✔ Django project structure ✔ ORM optimization techniques ✔ REST API best practices ✔ Started planning a production-level project Biggest takeaway 👇 👉 Writing code is one thing 👉 Understanding why you write it is everything In future: Authentication systems Role-based access File handling Real-world backend features If you’re learning backend development, let’s grow together 🚀 #Python #Django #BackendJourney #LearningInPublic #SoftwareDevelopment #DjangoDeveloper #DjangoTips #PythonDeveloper #BackendDevelopment #DjangoRestFramework #APIDevelopment #ServerSide #Programming #SoftwareDevelopment #CodingLife #DevCommunity
To view or add a comment, sign in
-
-
🚀 Ready to supercharge your coding skills with Python 3.11 on Ubuntu 22? 🌟 If you're a developer, data scientist, or tech enthusiast, you know that staying updated with the latest software versions is crucial for leveraging new features and enhancements. Python 3.11 is here, and it's packed with performance improvements and new capabilities that can revolutionize your projects! 🐍✨ Installing Python 3.11 on Ubuntu 22 is not just a technical upgrade; it's a step towards unlocking a new level of productivity and efficiency. Imagine writing cleaner, faster, and more efficient code that can handle complex tasks with ease. The new version brings improvements in error messages, better performance, and more intuitive syntax that makes coding a joy rather than a chore. 🖥️💡 Here's a quick guide to get you started: 1. Update your package list: `sudo apt update` 2. Install prerequisites: `sudo apt install software-properties-common` 3. Add the deadsnakes PPA: `sudo add-apt-repository ppa:deadsnakes/ppa` 4. Finally, install Python 3.11: `sudo apt install python3.11` And there you have it! You're now ready to explore the enhanced features of Python 3.11. 🎉 What feature of Python 3.11 are you most excited about? Let's discuss! Leave your thoughts in the comments and share this post to inspire your network. Together, we can harness the power of modern technology! 🔗🤝 #Python311 #Ubuntu22 #TechInnovation Looking forward to your feedback and stories! 😊
To view or add a comment, sign in
-
-
Let's Create Our First Microsoft 365 Agent SDK using Python - For Single Tenant. Step 1: Set Up Your Development Environment I am using VS Code, so you don’t need to manually install Python on your system (unless you want to).VS Code can handle Python via extensions which makes it super easy and everything at once place. You can download complete sample : here Install These Extensions in VS Code Open VS Code → Extensions → install: Python (Microsoft) Dev Tunnels (optional but helpful) GitHub Pull Requests & Issues ( Saves a lot of Download time) These ensure: You can run Python files directly inside VS Code IntelliSense / linting works Dev tunnel commands work in the integrated terminal Step 2: Download/Clone the Official Sample I am using this exact sample: Agent SDK Python Cards Run these commands inside VS Code Terminal: git clone https://lnkd.in/egtvCF7z cd Agents/samples/python/cards You now have the complete... #techcommunity #azure #microsoft https://lnkd.in/egZE68pZ
To view or add a comment, sign in
-
-
Most beginners ask: 👉 “Django or Flask?” Here’s the real answer (from experience) 👇 🔹 Use Django when: You need a full-fledged application Authentication, admin panel, ORM are required You want faster development with built-in features 🔹 Use Flask when: You need a lightweight service Building microservices or small APIs You want full control over components 💡 Real-world example: If I’m building an e-commerce platform → Django If I’m building a small internal API → Flask 👉 It’s not about which is better 👉 It’s about which fits your use case What do you prefer — Django or Flask? #Python #Django #Flask #BackendDevelopment #Programming
To view or add a comment, sign in
-
-
🚀 Day 13: Working with APIs in Python Modern applications don’t work in isolation they communicate with each other. 👉 That’s where APIs (Application Programming Interfaces) come in. APIs allow different systems to connect, share data, and perform actions seamlessly. 🔹 In Python, we commonly use the requests library to work with APIs. 💡 Example: import requests response = requests.get("https://lnkd.in/d2TEhSEA") data = response.json() print(data) 🔹 What can you do with APIs? ✔ Fetch data from servers ✔ Send data to external systems ✔ Integrate third-party services ✔ Build dynamic and real-time applications 📌 Real-world examples: ✔ Weather apps fetching live data ✔ Payment systems processing transactions ✔ Social media platforms sharing content 📌 Why it matters? APIs are the backbone of modern web development. Without APIs, applications wouldn’t be able to communicate or scale effectively. 💡 If you understand APIs, you can connect your application to the world. 📈 Step by step, building real-world development skills. #Python #API #WebDevelopment #Programming #Developers #BackendDevelopment #LearningJourney #Django
To view or add a comment, sign in
-
Explore related topics
- Optimizing Kubernetes Configurations for Production Deployments
- Reduce Kubernetes App Latency Without Scaling Nodes
- Simplifying Kubernetes Deployment for Developers
- Best Practices for Deploying Apps and Databases on Kubernetes
- Improve Kubernetes Performance Without Increasing Resources
- Kubernetes Deployment Strategies for Minimal Risk
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development