🐳 Docker Commands Explained: run, ps, and stop (with Nginx) When you start learning Docker, there are three commands that form the foundation of almost everything you'll do: • docker run — start a container • docker ps — see running containers • docker stop — stop a container safely If you understand these three, you already understand the basic lifecycle of a container. In this beginner-friendly guide, we walk through these commands step by step using a real example with Nginx, so you can actually see a container running in your browser. Inside the tutorial you’ll learn: • What happens when you run docker run nginx • Why containers sometimes block your terminal • How -d, -p, and --name flags work • How to check running containers with docker ps • The right way to stop containers using docker stop 📖 Read the full tutorial: https://lnkd.in/gdNX7UHX 💡 After learning the basics, the best way to truly understand Docker is by practicing with real containers. You can register on Docker HOL and explore hands-on Docker labs designed for students, beginners, and developers. ✔ Practical Docker exercises ✔ Real command-line workflows ✔ Step-by-step container labs 🔗 Start learning Docker: https://dockerhol.com #Docker #DevOps #LearnDocker #DockerCommands #Containerization #DockerTutorial
Docker Basics: run, ps, and stop with Nginx
More Relevant Posts
-
🐳 Docker exec: How to Get Inside a Running Container When you have a container running, one of the most common questions is: How do I actually get inside it? That’s exactly what the docker exec command is for. With docker exec, you can run commands inside a running container or open an interactive shell to inspect files, debug issues, or explore the environment. In this beginner-friendly tutorial, we break the command down step by step so it’s easy to understand and practice. Inside the guide you'll learn: • What docker exec actually does • The difference between docker run and docker exec • Why -it is used for interactive shells • How to open a shell inside a container using bash or sh • Running quick commands inside containers without entering a shell 📖 Read the full tutorial: https://lnkd.in/gKAQgNzu If you're learning Docker, the best way to understand commands like this is by trying them yourself. You can register on Docker HOL and explore hands-on Docker labs designed for students, beginners, and developers. ✔ Practice real Docker commands ✔ Interactive learning labs ✔ Step-by-step container exercises 🔗 Start learning Docker: https://dockerhol.com #Docker #DockerExec #DevOps #LearnDocker #Containerization #DockerTutorial
To view or add a comment, sign in
-
-
🐳 What is Docker? A Beginner’s Guide to Containerization If you're starting with Docker, you've probably heard developers say: "But it works on my machine!" Environment issues, dependency conflicts, and inconsistent deployments are common problems in software development. Docker solves this by packaging applications and their dependencies into portable containers that run the same everywhere. In this beginner-friendly tutorial, you’ll learn: • What Docker is and why it matters • Containers vs Virtual Machines • Docker Images and Containers explained • How Docker solves environment problems • A simple example to run your first container 📖 Read the full tutorial: https://lnkd.in/ghpga8eB 💡 Want to practice Docker instead of just reading about it? You can register on Docker HOL and start learning through hands-on labs designed for students, beginners, and developers. ✔ Interactive Docker labs ✔ Real commands and practical exercises ✔ Step-by-step learning path ✔ Built for beginners who want real experience 🔗 Start learning Docker: https://dockerhol.com #Docker #Containerization #DevOps #DockerTutorial #LearnDocker #CloudComputing
To view or add a comment, sign in
-
-
🚀 Learning Docker & Containerization I recently completed hands-on tutorials on Docker, exploring how containerization simplifies application development and deployment. Special thanks to Piyush Garg for the amazing tutorials that helped me understand Docker from basics to advanced concepts. 🔹 Topics I covered • Problem statement and need for containerization • Installation of Docker CLI & Docker Desktop • Understanding Images vs Containers • Running Ubuntu images inside containers • Working with multiple containers • Port mappings • Environment variables 🔹 Dockerizing a Node.js Application • Writing a Dockerfile • Understanding caching layers • Publishing images to Docker Hub 🔹 Docker Compose • Services • Port mapping • Environment variables 🔹 Advanced Concepts • Docker Networking (Bridge & Host) • Volume Mounting • Efficient caching in layers • Docker Multi-Stage Builds 🔹 Commands I practiced docker --version docker pull ubuntu docker run -it ubuntu docker ps docker images docker build -t myapp . docker compose up Excited to continue learning more about DevOps, containers, and cloud technologies. #Docker #DevOps #Containerization #NodeJS #CloudComputing #LearningJourney
To view or add a comment, sign in
-
🚀 Day 37/90 — Docker Revision Day Instead of rushing into new tools today, I did something equally important — revision. Over the past few days, I’ve been working deeply with Docker as part of my #90DaysOfDevOps journey. Today I consolidated everything I learned to make sure the fundamentals actually stick. Here’s what I revised today: 🐳 Running and managing containers 🐳 Building and tagging custom images 🐳 Writing Dockerfiles from scratch 🐳 Working with volumes and bind mounts 🐳 Container networking 🐳 Multi-container apps with Docker Compose 🐳 Multi-stage builds and pushing images to Docker Hub To make things easier for future reference, I also created a Docker Commands Cheat Sheet that covers the commands I’ll actually use while working with containers. 📌 Docker Cheat Sheet: One thing I realized today: Learning tools is easy — retaining them requires revision and practice. Also identified a couple of areas to strengthen: • Image layers & caching • CMD vs ENTRYPOINT Small steps every day → building real DevOps skills. #90DaysOfDevOps #DevOps #Docker #LearningInPublic #DevOpsJourney #TrainWithShubham #CloudComputing
To view or add a comment, sign in
-
90% of developers avoid Docker → then panic during deployments. But the other 10%? They ship code like clockwork. After teaching 1,000+ engineers Docker fundamentals, I've seen this pattern repeat endlessly. The Docker reality check: • Image = Your app's blueprint • Container = Blueprint comes alive • Dockerfile = The assembly instructions • Layers = Smart rebuilding (not everything from scratch) The workflow that matters: CLI → Daemon → Image → Container Most miss this: When you update code, Docker only rebuilds changed layers. Not the entire thing. One image can spawn dozens of containers. Think: 1 recipe → multiple meals. Bottom line: Master Docker basics, and Kubernetes suddenly makes sense. Skip it, and you'll struggle with every DevOps tool after. The foundation determines everything that follows. P.S. What's the biggest Docker concept that clicked for you? The...
To view or add a comment, sign in
-
Learning Docker for DevOps engineer 🐳 As someone transitioning into DevOps, I knew I needed to really understand containerization—not just follow tutorials, but build something real. Project: https://lnkd.in/dKuRrRrm 🎯 What I Built: ✅ Multi-container app (Java + Node.js + PostgreSQL + Nexus) ✅ Docker Compose orchestration ✅ Multi-stage builds (800MB → 250MB!) ✅ Custom networks for service isolation ✅ Persistent volumes (learned this the hard way) ✅ Deployed to DigitalOcean droplets 💡 Concepts That Clicked: 🔹 Containers ≠ VMs Completely different paradigm. VMs virtualize hardware. Containers virtualize the OS. 🔹 Multi-stage builds Build dependencies don't belong in production images. My Java app dropped from 800MB to 250MB. 🔹 Docker networks Services discover each other by name. Java app reaches Nexus at `http://nexus:8081`. No IP configs needed. 🔹 Volumes save lives Lost my entire Nexus repository once when I restarted a container. Volumes = data that survives. 📚 Learning Journey: Week 1: Breaking everything "Why does my container exit immediately?" "Where's my database data?" "How do containers communicate?" Week 2: Everything clicks Multi-stage builds, networks, volumes—it all makes sense now. 🛠️ Tech Stack: 🐳 Docker & Docker Compose ☕ Java (Maven) 🟢 Node.js 🐘 PostgreSQL 📦 Nexus Repository 🔧 Nginx ☁️ DigitalOcean 🎓 Skills Gained: - Writing efficient Dockerfiles - Orchestrating multi-container apps - Managing persistent data - Container networking - Cloud deployment (DigitalOcean) - Debugging containerized apps 📖 Project Includes: ✓ Documented Dockerfiles (with WHY, not just WHAT) ✓ Docker Compose setup ✓ Volume & networking examples ✓ DigitalOcean deployment guide ✓ Mistakes I made + fixes ✓ Security basics 💭 Real Talk: This is a learning project, not production-ready. But it gave me hands-on experience with Docker concepts that matter in DevOps. Learning by building beats following tutorials every time. 🎯 Next Steps: - Kubernetes orchestration - CI/CD with Jenkins - Terraform for IaC - Monitoring setup For anyone learning DevOps: build something, break it, fix it, repeat. That's how concepts stick. Check it out: https://lnkd.in/dKuRrRrm Fellow learners: What project made Docker click for you? 👇 #DevOps #Docker #LearningInPublic #Containerization #CloudEngineering #CareerTransition
To view or add a comment, sign in
-
🚫Stop Watching Docker Tutorials🚫 You don’t learn Docker by watching someone else type commands. You learn it when things break… and you fix them. If you’re still stuck in tutorial mode, here’s your wake-up call: 🔥 Build This Instead: 1️⃣ Run Your First Container Stop overthinking. Run Nginx. Map ports. Hit localhost. See it live. 2️⃣ Build Your Own Image Write a Dockerfile from scratch. Break it. Fix it. Run your own app. 3️⃣ Make Data Survive Use volumes. Delete the container. If your data is gone, you did it wrong. 4️⃣ Connect Containers Like a Real System Create a network. App talks to DB. No localhost shortcuts. Real communication. 5️⃣ Go Multi-Container Write your first docker-compose.yml Spin up full stack in one command. 6️⃣ Push to the Real World Tag your image. Push to Docker Hub. Pull it somewhere else. If it works — you’re learning. 7️⃣ Optimize Like an Engineer Use multi-stage builds. Cut your image size down brutally. 8️⃣ Automate Everything Set up GitHub Actions. Push code → build image → ship it automatically. Watching tutorials feels productive but it isn’t. Building systems and gaining practical knowledge is. Do this once properly and you won’t need another Docker tutorial again. #Docker #DevOps #Cloud #Engineering #CICD
To view or add a comment, sign in
-
-
🚀 Understanding What Happens Inside a Dockerfile (Step-by-Step) Many people start using Docker by simply running containers. But the real magic happens inside a Dockerfile — the blueprint that tells Docker how to build your application environment. Think of a Dockerfile like a recipe. Each instruction runs step-by-step and builds the final container image. Let’s understand the actual order Docker follows while building an image. 📦 1️⃣ FROM – The Starting Point Every Docker image begins with a base image. Example: FROM ubuntu:22.04 This tells Docker to start building the container using Ubuntu as the foundation. 📂 2️⃣ WORKDIR – Set Working Directory Defines where the application will run inside the container. Example: WORKDIR /app All upcoming instructions will run inside this directory. 🌐 3️⃣ ENV – Environment Variables Used to store configuration values. Example: ENV NODE_ENV=production Applications inside the container can use these variables. 📁 4️⃣ COPY / ADD – Add Application Files Copies files from your system into the container. Example: COPY . . COPY is commonly used, while ADD has some extra capabilities like extracting archives. ⚙️ 5️⃣ RUN – Install Dependencies Executes commands during the image build. Example: RUN apt-get update && apt-get install -y python3 This prepares everything the application needs before it runs. 🌐 6️⃣ EXPOSE – Declare Application Port Example: EXPOSE 3000 This documents which port the application inside the container will use. 🚀 7️⃣ ENTRYPOINT – Main Execution Command Defines the main command that always runs when the container starts. Example: ENTRYPOINT ["python3"] ▶️ 8️⃣ CMD – Default Command Provides default arguments or commands. Example: CMD ["app.py"] If no command is provided while running the container, Docker uses CMD. 💡 In simple terms A Dockerfile tells Docker: Start with a base image → set a working folder → define variables → copy files → install dependencies → declare ports → define how the container runs. That’s how a Docker image becomes production ready. 💬 DevOps engineers: Which Dockerfile instruction do you use the most? #Docker #Containerization #DevOps #CloudComputing #TechLearning #SoftwareEngineering
To view or add a comment, sign in
-
🚀 Understanding What Happens Inside a Dockerfile (Step-by-Step) Many people start using Docker by simply running containers. But the real magic happens inside a Dockerfile — the blueprint that tells Docker how to build your application environment. Think of a Dockerfile like a recipe. Each instruction runs step-by-step and builds the final container image. Let’s understand the actual order Docker follows while building an image. 📦 1️⃣ FROM – The Starting Point Every Docker image begins with a base image. Example: FROM ubuntu:22.04 This tells Docker to start building the container using Ubuntu as the foundation. 📂 2️⃣ WORKDIR – Set Working Directory Defines where the application will run inside the container. Example: WORKDIR /app All upcoming instructions will run inside this directory. 🌐 3️⃣ ENV – Environment Variables Used to store configuration values. Example: ENV NODE_ENV=production Applications inside the container can use these variables. 📁 4️⃣ COPY / ADD – Add Application Files Copies files from your system into the container. Example: COPY . . COPY is commonly used, while ADD has some extra capabilities like extracting archives. ⚙️ 5️⃣ RUN – Install Dependencies Executes commands during the image build. Example: RUN apt-get update && apt-get install -y python3 This prepares everything the application needs before it runs. 🌐 6️⃣ EXPOSE – Declare Application Port Example: EXPOSE 3000 This documents which port the application inside the container will use. 🚀 7️⃣ ENTRYPOINT – Main Execution Command Defines the main command that always runs when the container starts. Example: ENTRYPOINT ["python3"] ▶️ 8️⃣ CMD – Default Command Provides default arguments or commands. Example: CMD ["app.py"] If no command is provided while running the container, Docker uses CMD. 💡 In simple terms A Dockerfile tells Docker: Start with a base image → set a working folder → define variables → copy files → install dependencies → declare ports → define how the container runs. That’s how a Docker image becomes production ready. 💬 DevOps engineers: Which Dockerfile instruction do you use the most? #Docker #Containerization #DevOps #CloudComputing #TechLearning #SoftwareEngineering
To view or add a comment, sign in
-
🚀 From Learning to Running My First Docker Container Today! 🐳 Today I took another step in my DevOps learning journey by exploring Docker, one of the most widely used tools in modern application deployment. One common challenge developers face is: 👉 It works on my machine, but not on the server. Today I understood how Docker solves this problem by using containers. 💡 What is Docker? Docker is a containerization platform that packages an application along with all its dependencies into a lightweight container, ensuring the application runs consistently across different environments. 📚 Key Concepts I Learned Today 🔹 Docker Image – Blueprint used to create containers 🔹 Docker Container – Running instance of an image 🔹 Dockerfile – Script used to build Docker images 🔹 Docker Hub – Registry to store and share images 🔹 Port Mapping – Connecting the host machine to container services ⚙️ Hands-on Commands I Practiced docker --version docker pull nginx docker images docker run -d -p 8080:80 nginx docker ps docker ps -a docker logs <container_id> docker stop <container_id> docker rm <container_id> 🔗 Practical Experiment I Did I successfully ran an Nginx container and connected it with my host machine using port mapping. After running the container, I accessed it in my browser using: 👉 http://localhost:8080 Seeing the container run successfully and accessing it from the browser was a great hands-on learning experience. #Docker #DevOps #Containerization #LearningInPublic #CloudComputing #TechJourney #FutureDevOpsEngineer
To view or add a comment, sign in
-
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