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

What's hot

Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Multi Stage Docker Build
Multi Stage Docker Build Multi Stage Docker Build
Multi Stage Docker Build
Prasenjit Sarkar
 
React hooks
React hooksReact hooks
React hooks
Sadhna Rana
 
Context API in React
Context API in ReactContext API in React
Context API in React
Lucas Lira Gomes
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An Overview
Naveen Pete
 
React hooks
React hooksReact hooks
React hooks
Assaf Gannon
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
Varun Raj
 
Docker
DockerDocker
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
valuebound
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a Dockerfile
Knoldus Inc.
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
Imran Sayed
 
Gatsby intro
Gatsby introGatsby intro
Gatsby intro
Ben McCormick
 
Puppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolPuppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing Tool
Miki Lombardi
 
React-JS Component Life-cycle Methods
React-JS Component Life-cycle MethodsReact-JS Component Life-cycle Methods
React-JS Component Life-cycle Methods
ANKUSH CHAVAN
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
Derek Willian Stavis
 
Introduction to Magento PWA
Introduction to Magento PWAIntroduction to Magento PWA
Introduction to Magento PWA
Abid Malik
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
Jian Wu
 
Using API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonyconUsing API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonycon
Antonio Peric-Mazar
 
بالعربيةAngular js(ar)تحميل كتاب دورة لتعلم
بالعربيةAngular js(ar)تحميل كتاب دورة لتعلم بالعربيةAngular js(ar)تحميل كتاب دورة لتعلم
بالعربيةAngular js(ar)تحميل كتاب دورة لتعلم
NoureddineHassi
 
All about Context API
All about Context APIAll about Context API
All about Context API
Souvik Basu
 

What's hot (20)

Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Multi Stage Docker Build
Multi Stage Docker Build Multi Stage Docker Build
Multi Stage Docker Build
 
React hooks
React hooksReact hooks
React hooks
 
Context API in React
Context API in ReactContext API in React
Context API in React
 
Mean Stack - An Overview
Mean Stack - An OverviewMean Stack - An Overview
Mean Stack - An Overview
 
React hooks
React hooksReact hooks
React hooks
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
Docker
DockerDocker
Docker
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
How to write a Dockerfile
How to write a DockerfileHow to write a Dockerfile
How to write a Dockerfile
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
 
Gatsby intro
Gatsby introGatsby intro
Gatsby intro
 
Puppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing ToolPuppeteer - A web scraping & UI Testing Tool
Puppeteer - A web scraping & UI Testing Tool
 
React-JS Component Life-cycle Methods
React-JS Component Life-cycle MethodsReact-JS Component Life-cycle Methods
React-JS Component Life-cycle Methods
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
 
Introduction to Magento PWA
Introduction to Magento PWAIntroduction to Magento PWA
Introduction to Magento PWA
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
 
Using API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonyconUsing API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonycon
 
بالعربيةAngular js(ar)تحميل كتاب دورة لتعلم
بالعربيةAngular js(ar)تحميل كتاب دورة لتعلم بالعربيةAngular js(ar)تحميل كتاب دورة لتعلم
بالعربيةAngular js(ar)تحميل كتاب دورة لتعلم
 
All about Context API
All about Context APIAll about Context API
All about Context API
 

Similar to Magento Docker Setup.pdf

Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
InfluxData
 
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
BADR
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
Amr Fawzy
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
RightScale
 
DOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDESDOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDES
MuhammadAhmed651877
 
Docker 101
Docker 101Docker 101
Docker 101
Hung-Che Lo
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ElasTest Project
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
Micael Gallego
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
Samuel Chow
 
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornosTesting fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Micael Gallego
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with Docker
Eric Smalling
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
Naukri.com
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
JasonStraughan1
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
Anvay Patil
 
Docker on Power Systems
Docker on Power SystemsDocker on Power Systems
Docker on Power Systems
Cesar Maciel
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
Docker, Inc.
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
Docker, Inc.
 
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
Introduction to Docker for NodeJs developers at Node DC 2/26/2014Introduction to Docker for NodeJs developers at Node DC 2/26/2014
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
lenworthhenry
 

Similar to Magento Docker Setup.pdf (20)

Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
 
Docker up and Running For Web Developers
Docker up and Running For Web DevelopersDocker up and Running For Web Developers
Docker up and Running For Web Developers
 
Docker Up and Running for Web Developers
Docker Up and Running for Web DevelopersDocker Up and Running for Web Developers
Docker Up and Running for Web Developers
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
DOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDESDOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDES
 
Docker 101
Docker 101Docker 101
Docker 101
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Testing fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornosTesting fácil con Docker: Gestiona dependencias y unifica entornos
Testing fácil con Docker: Gestiona dependencias y unifica entornos
 
Best Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with DockerBest Practices for Developing & Deploying Java Applications with Docker
Best Practices for Developing & Deploying Java Applications with Docker
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Docker on Power Systems
Docker on Power SystemsDocker on Power Systems
Docker on Power Systems
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
Introduction to Docker for NodeJs developers at Node DC 2/26/2014Introduction to Docker for NodeJs developers at Node DC 2/26/2014
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
 

Recently uploaded

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 

Recently uploaded (20)

Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 

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