SlideShare a Scribd company logo
Docker
Abid H. Malik
The problems
● IROMS (It Runs On My System) Syndrome.
● Unwanted updates to a system library / package / service.
● Underlying OS / OS Components changed.
● Upgrade in one service for Project A affected Project B.
● Team does not have standardized setup.
● Setup on new systems takes a lot of time.
Containerization
● Containerization involves encapsulating or packaging up software code and all its
dependencies so that it can run uniformly and consistently on any infrastructure.
● Develop and run the application inside an isolated environment (known as a container)
that matches your final deployment environment.
● Put your application inside a single file (known as an image) along with all its
dependencies and necessary deployment configurations.
● And share that image through a central server (known as a registry) that is accessible by
anyone with proper authorization
● Docker is One of many implementations of the ides of Containerization.
● It's an open-source containerization platform that allows you to containerize your
applications, share them using public or private registries, and also to orchestrate them.
What is Docker?
01 Docker is an open platform for developing, shipping, and running applications.
Docker enables you to separate your applications from your infrastructure so
you can deliver software quickly.
02 Docker provides the ability to package and run an application in a loosely
isolated environment called a container. The isolation and security allow you to
run many containers simultaneously on a given host.
03 Docker is a tool designed to make it easier to create, deploy, and run
applications by using containers. Docker containers are lightweight alternatives
to Virtual Machines and it uses the host OS.
Docker Benefits
● Runs on my machine = runs anywhere.
● New team member can be productive from day 1.
● Test app's compatibility with the newer version of
language/database.
● Boosts your career. (Preference for Docker Skill up by 50%).
● And lot more….
Docker architecture
● The Docker daemon (dockerd)
● The Docker client (docker)
● Docker Desktop
● Docker registries
● Docker objects
○ Containers
○ Images
○ Networks
○ Volumes
○ plugins
Docker + Magento
Prerequisites
● Docker hub account
● Docker Desktop (Mac OS and Windows)
● Docker WSL Linux Image setup (Windows only)
● Docker Engine (for Linux)
○ https://docs.docker.com/engine/install/ubuntu/
● Post-installation steps for Linux
○ https://docs.docker.com/engine/install/linux-postinstall/
● Docker Compose
○ https://docs.docker.com/compose/install/
● Git
● Composer
● Magento Marketplace Keys
● Curl
Setup New Project - Automated
1. Create your project directory then go into it:
a. mkdir ~/Sites/magento
b. cd $_
2. Run this automated one-liner from the directory you want to install your project.
a. curl -s
https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup |
bash -s -- magento.test 2.4.3-p1
3. After the one-liner above completes running, you should be able to access your site
at https://magento.test
Setup New Project - Manual
1) Create your project directory then go into it:
a) mkdir ~/Sites/magento
b) cd $_
2) Download the Docker Compose template:
a) curl -s
https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template |
bash
3) Download the version of Magento you want to use with:
a) bin/download 2.4.3-p1
4) Run the setup installer for Magento:
a) bin/setup magento.test
5) open https://magento.test
Setup Existing Projects
1. Take a backup of your existing database:
a. bin/mysqldump > ~/Sites/existing/magento.sql
2. Create your project directory then go into it:
a. mkdir ~/Sites/magento
b. cd $_
3. Download the Docker Compose template:
a. curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash
4. Replace with existing source code of your existing Magento instance:
a. cp -R ~/Sites/existing src OR
b. git clone git@github.com:myrepo.git src
5. Start some containers, copy files to them and then restart the containers:
a. docker-compose -f docker-compose.yml up -d
b. bin/copytocontainer --all
Setup Existing Projects - Contd…
6. Import existing database:
a. bin/mysql < ../existing/magento.sql
7. Update database connection details to use the above Docker MySQL credentials:
a. creds for the MySQL server are defined at startup from env/db.env
8. Import app-specific environment settings:
a. bin/magento app:config:import
9. Create a DNS host entry and setup Magento base url
a. bin/setup-domain yoursite.test
10. bin/restart
11. open https://yoursite.test
Important Files
● docker-compose.yml
● docker-compose.dev.yml
● bin/*
● env/*
Important CLI commands
● bin/bash
○ Drop into the bash prompt of your Docker container.
● bin/cli
○ Run any CLI command without going into the bash prompt. Ex. bin/cli ls
● bin/composer
○ Run the composer binary. Ex. bin/composer install
● bin/copyfromcontainer
○ Copy folders or files from container to host. Ex. bin/copyfromcontainer vendor
● bin/copytocontainer
○ Copy folders or files from host to container. Ex. bin/copytocontainer --all
● bin/cron:
○ Start or stop the cron service. Ex. bin/cron start
Important CLI commands - Contd…
● bin/fixowns
○ This will fix filesystem ownerships within the container.
● bin/fixperms
○ This will fix filesystem permissions within the container.
● bin/magento
○ Run the Magento CLI. Ex: bin/magento cache:flush
● bin/mysql
○ Run the MySQL CLI with database config from env/db.env
● bin/mysqldump
○ Backup the Magento database. Ex. bin/mysqldump > magento.sql
● bin/status:
○ Check the container status.
Important CLI commands - Contd…
● bin/stop
○ Stop all project containers.
● bin/start
○ Start all containers, good practice to use this instead of docker-compose up -d, as it may contain
additional helpers.
● bin/restart
○ Stop and then start all containers.
● bin/setup-domain
○ Setup Magento domain name. Ex: bin/setup-domain magento.test
● bin/update
○ Update your project to the most recent version of docker-magento
Miscellaneous Commands
● Get IP address of remote host (host.docker.internal)
○ docker run --rm alpine ip route | awk 'NR==1 {print $3}'
● Get IP address of container
○ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container_id>
Helpful Links
● https://hub.docker.com/login
● https://www.docker.com/products/docker-desktop
● https://docs.docker.com/engine/install/ubuntu/
● https://docs.docker.com/engine/install/linux-postinstall/
● https://docs.docker.com/compose/install/
● https://github.com/markshust/docker-magento#docker-hub
● https://account.magento.com/customer/account/login
Thank you!

More Related Content

PDF
Microcontroleur arduino uno
PPTX
Web Engineering (Storage Tiers) web.pptx
PPTX
web development.pptx
PPT
PPTX
Express js
PPTX
Introduction à Node.js
PPT
Dream weaver ppt
PPTX
Microcontroleur arduino uno
Web Engineering (Storage Tiers) web.pptx
web development.pptx
Express js
Introduction à Node.js
Dream weaver ppt

What's hot (20)

PPTX
Creating Responsive Website Using Bootstrap
PPTX
Socket programming in Java (PPTX)
PPTX
Angular js PPT
PDF
HKG15-311: OP-TEE for Beginners and Porting Review
PDF
what is java.pdf
PPTX
ADOBE DREAMWEAVER
 
PPTX
Android architecture
PPT
Cours Middleware orientés objets
PDF
Support developpement applications mobiles avec ionic v3 et v4
PPTX
What Is Express JS?
PPTX
Basic Concept of Node.js & NPM
PPTX
Web Development
PDF
Workshop 4: NodeJS. Express Framework & MongoDB.
PPTX
Java script
PPT
Ppt of web development
DOCX
Location Tracking of Android Device Based on SMS.
PPT
Introduction to .NET Framework
PPTX
Visual studio code
PPTX
HTML (Web) basics for a beginner
PDF
Android-Tp1: éléments graphiques de base et intents
Creating Responsive Website Using Bootstrap
Socket programming in Java (PPTX)
Angular js PPT
HKG15-311: OP-TEE for Beginners and Porting Review
what is java.pdf
ADOBE DREAMWEAVER
 
Android architecture
Cours Middleware orientés objets
Support developpement applications mobiles avec ionic v3 et v4
What Is Express JS?
Basic Concept of Node.js & NPM
Web Development
Workshop 4: NodeJS. Express Framework & MongoDB.
Java script
Ppt of web development
Location Tracking of Android Device Based on SMS.
Introduction to .NET Framework
Visual studio code
HTML (Web) basics for a beginner
Android-Tp1: éléments graphiques de base et intents
Ad

Similar to Magento Docker Setup.pdf (20)

PPTX
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
PPTX
[Codelab 2017] Docker 기초 및 활용 방안
PDF
Faster and Easier Software Development using Docker Platform
PPTX
Docker Basics
PPTX
Docker In Brief
PDF
Scale Big With Docker — Moboom 2014
PDF
Introduction to Docker - Learning containerization XP conference 2016
PPTX
Containerization using docker and its applications
PPTX
Containerization using docker and its applications
PDF
Docker: A New Way to Turbocharging Your Apps Development
PPTX
Cont0519
PPTX
Docker container a-brief_introduction_2016-01-30
PPTX
Java developer intro to environment management with vagrant puppet and docker
PDF
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
PPTX
Docker Ecosystem on Azure
PPTX
Docker for Web Developers: A Sneak Peek
PDF
Dockercon 23 - Getting started with Docker
PDF
ContainerDayVietnam2016: Dockerize a small business
PPTX
Introduction to automated environment management with Docker Containers - for...
PDF
Docker - Frank Maounis
#3 Hanoi Magento Meetup - Part 2: Scalable Magento Development With Containers
[Codelab 2017] Docker 기초 및 활용 방안
Faster and Easier Software Development using Docker Platform
Docker Basics
Docker In Brief
Scale Big With Docker — Moboom 2014
Introduction to Docker - Learning containerization XP conference 2016
Containerization using docker and its applications
Containerization using docker and its applications
Docker: A New Way to Turbocharging Your Apps Development
Cont0519
Docker container a-brief_introduction_2016-01-30
Java developer intro to environment management with vagrant puppet and docker
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Docker Ecosystem on Azure
Docker for Web Developers: A Sneak Peek
Dockercon 23 - Getting started with Docker
ContainerDayVietnam2016: Dockerize a small business
Introduction to automated environment management with Docker Containers - for...
Docker - Frank Maounis
Ad

More from Abid Malik (6)

PDF
Magento 2: Dependency Injection
PDF
Composer Best Practices
PDF
Introduction to Xdebug
PDF
IDE and Toolset For Magento Development
PDF
Introduction to Magento PWA
PPTX
Magento Overview
Magento 2: Dependency Injection
Composer Best Practices
Introduction to Xdebug
IDE and Toolset For Magento Development
Introduction to Magento PWA
Magento Overview

Recently uploaded (20)

PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PPTX
A Presentation on Artificial Intelligence
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Approach and Philosophy of On baking technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
Per capita expenditure prediction using model stacking based on satellite ima...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Monthly Chronicles - July 2025
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
A Presentation on Artificial Intelligence
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Approach and Philosophy of On baking technology

Magento Docker Setup.pdf

  • 2. The problems ● IROMS (It Runs On My System) Syndrome. ● Unwanted updates to a system library / package / service. ● Underlying OS / OS Components changed. ● Upgrade in one service for Project A affected Project B. ● Team does not have standardized setup. ● Setup on new systems takes a lot of time.
  • 3. Containerization ● Containerization involves encapsulating or packaging up software code and all its dependencies so that it can run uniformly and consistently on any infrastructure. ● Develop and run the application inside an isolated environment (known as a container) that matches your final deployment environment. ● Put your application inside a single file (known as an image) along with all its dependencies and necessary deployment configurations. ● And share that image through a central server (known as a registry) that is accessible by anyone with proper authorization ● Docker is One of many implementations of the ides of Containerization. ● It's an open-source containerization platform that allows you to containerize your applications, share them using public or private registries, and also to orchestrate them.
  • 4. What is Docker? 01 Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. 02 Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host. 03 Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Docker containers are lightweight alternatives to Virtual Machines and it uses the host OS.
  • 5. Docker Benefits ● Runs on my machine = runs anywhere. ● New team member can be productive from day 1. ● Test app's compatibility with the newer version of language/database. ● Boosts your career. (Preference for Docker Skill up by 50%). ● And lot more….
  • 6. Docker architecture ● The Docker daemon (dockerd) ● The Docker client (docker) ● Docker Desktop ● Docker registries ● Docker objects ○ Containers ○ Images ○ Networks ○ Volumes ○ plugins
  • 8. Prerequisites ● Docker hub account ● Docker Desktop (Mac OS and Windows) ● Docker WSL Linux Image setup (Windows only) ● Docker Engine (for Linux) ○ https://docs.docker.com/engine/install/ubuntu/ ● Post-installation steps for Linux ○ https://docs.docker.com/engine/install/linux-postinstall/ ● Docker Compose ○ https://docs.docker.com/compose/install/ ● Git ● Composer ● Magento Marketplace Keys ● Curl
  • 9. Setup New Project - Automated 1. Create your project directory then go into it: a. mkdir ~/Sites/magento b. cd $_ 2. Run this automated one-liner from the directory you want to install your project. a. curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.3-p1 3. After the one-liner above completes running, you should be able to access your site at https://magento.test
  • 10. Setup New Project - Manual 1) Create your project directory then go into it: a) mkdir ~/Sites/magento b) cd $_ 2) Download the Docker Compose template: a) curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash 3) Download the version of Magento you want to use with: a) bin/download 2.4.3-p1 4) Run the setup installer for Magento: a) bin/setup magento.test 5) open https://magento.test
  • 11. Setup Existing Projects 1. Take a backup of your existing database: a. bin/mysqldump > ~/Sites/existing/magento.sql 2. Create your project directory then go into it: a. mkdir ~/Sites/magento b. cd $_ 3. Download the Docker Compose template: a. curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/template | bash 4. Replace with existing source code of your existing Magento instance: a. cp -R ~/Sites/existing src OR b. git clone git@github.com:myrepo.git src 5. Start some containers, copy files to them and then restart the containers: a. docker-compose -f docker-compose.yml up -d b. bin/copytocontainer --all
  • 12. Setup Existing Projects - Contd… 6. Import existing database: a. bin/mysql < ../existing/magento.sql 7. Update database connection details to use the above Docker MySQL credentials: a. creds for the MySQL server are defined at startup from env/db.env 8. Import app-specific environment settings: a. bin/magento app:config:import 9. Create a DNS host entry and setup Magento base url a. bin/setup-domain yoursite.test 10. bin/restart 11. open https://yoursite.test
  • 13. Important Files ● docker-compose.yml ● docker-compose.dev.yml ● bin/* ● env/*
  • 14. Important CLI commands ● bin/bash ○ Drop into the bash prompt of your Docker container. ● bin/cli ○ Run any CLI command without going into the bash prompt. Ex. bin/cli ls ● bin/composer ○ Run the composer binary. Ex. bin/composer install ● bin/copyfromcontainer ○ Copy folders or files from container to host. Ex. bin/copyfromcontainer vendor ● bin/copytocontainer ○ Copy folders or files from host to container. Ex. bin/copytocontainer --all ● bin/cron: ○ Start or stop the cron service. Ex. bin/cron start
  • 15. Important CLI commands - Contd… ● bin/fixowns ○ This will fix filesystem ownerships within the container. ● bin/fixperms ○ This will fix filesystem permissions within the container. ● bin/magento ○ Run the Magento CLI. Ex: bin/magento cache:flush ● bin/mysql ○ Run the MySQL CLI with database config from env/db.env ● bin/mysqldump ○ Backup the Magento database. Ex. bin/mysqldump > magento.sql ● bin/status: ○ Check the container status.
  • 16. Important CLI commands - Contd… ● bin/stop ○ Stop all project containers. ● bin/start ○ Start all containers, good practice to use this instead of docker-compose up -d, as it may contain additional helpers. ● bin/restart ○ Stop and then start all containers. ● bin/setup-domain ○ Setup Magento domain name. Ex: bin/setup-domain magento.test ● bin/update ○ Update your project to the most recent version of docker-magento
  • 17. Miscellaneous Commands ● Get IP address of remote host (host.docker.internal) ○ docker run --rm alpine ip route | awk 'NR==1 {print $3}' ● Get IP address of container ○ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container_id>
  • 18. Helpful Links ● https://hub.docker.com/login ● https://www.docker.com/products/docker-desktop ● https://docs.docker.com/engine/install/ubuntu/ ● https://docs.docker.com/engine/install/linux-postinstall/ ● https://docs.docker.com/compose/install/ ● https://github.com/markshust/docker-magento#docker-hub ● https://account.magento.com/customer/account/login