SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Downloaden Sie, um offline zu lesen
Introducing Docker
Application Containerization
&
Service Orchestration
Sawood Alam <@ibnesayeed>
Old Dominion University
Norfolk, Virginia - 23529 (USA)
Dockerizing ArchiveSpark
A 30 minutes of Pair Hacking made
running a complex software as easy as:
$ docker run -p 8888:8888 ibnesayeed/archivespark
https://ws-dl.blogspot.com/2016/07/2016-07-21-dockerizing-archivespark.html
Read the full story at:
Relatables
● The Magic Laptop problem
● Wish, these researchers document their code
● Cannot upgrade X to run Y because Z will break
● This project is the spaghetti of a dozen different technologies
● Yay! Got new machine :-) … Wait! I need to install & configure everything again ;-(
● Too many VMs to manage
What Is Docker?
● An application container
● Packages dependencies
● Isolates applications
● Processes run on the host OS
● Uses Linux cgroups and namespaces
● Lighter than a virtual machine
● Open-source
Host OS
Host OS
Docker Engine
Bins/Libs
App B
Bins/Libs
App A
Container
Dockerization Process
Dockerfile ImageBuild Run Container
AUFS
file1 file2
file2
file3
file4
file1 file3
file1 file2 file3 file4 file5
Image Base Layer
Image Layer 1
Image Layer 2
Container Layer
More Layers ...
Link Extractor Script
#!/usr/bin/env python
import sys
import requests
from bs4 import BeautifulSoup
res = requests.get(sys.argv[-1])
soup = BeautifulSoup(res.text, "html.parser")
for link in soup.find_all("a"):
print(link.get("href"))
linkextractor.py
● Is it executable?
● Is Python installed?
● Are necessary libraries installed?
● Can you install needed software?
Dockerized Link Extractor Script
#!/usr/bin/env python
import sys
import requests
from bs4 import BeautifulSoup
res = requests.get(sys.argv[-1])
soup = BeautifulSoup(res.text, "html.parser")
for link in soup.find_all("a"):
print(link.get("href"))
FROM python
LABEL maintainer="Sawood Alam <@ibnesayeed>"
RUN pip install beautifulsoup4
RUN pip install requests
COPY linkextractor.py /app/
WORKDIR /app
RUN chmod a+x linkextractor.py
ENTRYPOINT ["./linkextractor.py"]
linkextractor.py Dockerfile
Try It
me@thishost$ ls
>> Dockerfile main.py
# Build an image from the Dockerfile (change "ibnesayeed" with your Docker ID)
me@thishost$ docker image build -t ibnesayeed/linkextractor .
>> Layered docker image...
# Run a container from the locally built image
me@thishost$ docker container run ibnesayeed/linkextractor https://odu.edu/
>> Extracted links…
# Push the image to the registry
me@thishost$ docker image push ibnesayeed/linkextractor
# Log in to a different host
me@thishost$ ssh you@otherhost
# Run a container on the other host using the image in the registry
you@otherhost$ docker container run ibnesayeed/linkextractor https://example.com/
>> Pull the image from the registry (if not cached already)
>> Extracted links...
Orchestration Demo
Web App
API Server
Live Web
Redis Cache
https://github.com/ibnesayeed/linkextractor
Useful Links
● https://github.com/ibnesayeed/linkextractor
● https://docs.docker.com/
● http://training.play-with-docker.com/
● https://ws-dl.blogspot.com/
● https://ws-dl.blogspot.com/2016/07/2016-07-21-dockerizing-archivespark.html
Sawood Alam <@ibnesayeed>

Weitere ähnliche Inhalte

Mehr von Sawood Alam

Mehr von Sawood Alam (20)

MementoMap: An Archive Profile Dissemination Framework
MementoMap: An Archive Profile Dissemination FrameworkMementoMap: An Archive Profile Dissemination Framework
MementoMap: An Archive Profile Dissemination Framework
 
Impact of HTTP Cookie Violations in Web Archives
Impact of HTTP Cookie Violations in Web ArchivesImpact of HTTP Cookie Violations in Web Archives
Impact of HTTP Cookie Violations in Web Archives
 
Archive Assisted Archival Fixity Verification Framework
Archive Assisted Archival Fixity Verification FrameworkArchive Assisted Archival Fixity Verification Framework
Archive Assisted Archival Fixity Verification Framework
 
MementoMap Framework for Flexible and Adaptive Web Archive Profiling
MementoMap Framework for Flexible and Adaptive Web Archive ProfilingMementoMap Framework for Flexible and Adaptive Web Archive Profiling
MementoMap Framework for Flexible and Adaptive Web Archive Profiling
 
Web ARChive (WARC) File Format
Web ARChive (WARC) File FormatWeb ARChive (WARC) File Format
Web ARChive (WARC) File Format
 
InterPlanetary Wayback: The Next Step Towards Decentralized Web Archiving
InterPlanetary Wayback: The Next Step Towards Decentralized Web ArchivingInterPlanetary Wayback: The Next Step Towards Decentralized Web Archiving
InterPlanetary Wayback: The Next Step Towards Decentralized Web Archiving
 
MemGator - A Memento Aggregator CLI and Server in Go
MemGator - A Memento Aggregator CLI and Server in GoMemGator - A Memento Aggregator CLI and Server in Go
MemGator - A Memento Aggregator CLI and Server in Go
 
Dockerize Your Projects - A Brief Introduction to Containerization
Dockerize Your Projects - A Brief Introduction to ContainerizationDockerize Your Projects - A Brief Introduction to Containerization
Dockerize Your Projects - A Brief Introduction to Containerization
 
Avoiding Zombies in Archival Replay Using ServiceWorker
Avoiding Zombies in Archival Replay Using ServiceWorkerAvoiding Zombies in Archival Replay Using ServiceWorker
Avoiding Zombies in Archival Replay Using ServiceWorker
 
Client-side Reconstruction of Composite Mementos Using ServiceWorker
Client-side Reconstruction of Composite Mementos Using ServiceWorkerClient-side Reconstruction of Composite Mementos Using ServiceWorker
Client-side Reconstruction of Composite Mementos Using ServiceWorker
 
TPDL 2016 Doctoral Consortium - Web Archive Profiling
TPDL 2016 Doctoral Consortium - Web Archive ProfilingTPDL 2016 Doctoral Consortium - Web Archive Profiling
TPDL 2016 Doctoral Consortium - Web Archive Profiling
 
Introducing Web Archiving and WSDL Research Group
Introducing Web Archiving and WSDL Research GroupIntroducing Web Archiving and WSDL Research Group
Introducing Web Archiving and WSDL Research Group
 
InterPlanetary Wayback: Peer-To-Peer Permanence of Web Archives
InterPlanetary Wayback: Peer-To-Peer Permanence of Web ArchivesInterPlanetary Wayback: Peer-To-Peer Permanence of Web Archives
InterPlanetary Wayback: Peer-To-Peer Permanence of Web Archives
 
Web Archive Profiling Through Fulltext Search
Web Archive Profiling Through Fulltext SearchWeb Archive Profiling Through Fulltext Search
Web Archive Profiling Through Fulltext Search
 
JCDL 2016 Doctoral Consortium - Web Archive Profiling
JCDL 2016 Doctoral Consortium - Web Archive ProfilingJCDL 2016 Doctoral Consortium - Web Archive Profiling
JCDL 2016 Doctoral Consortium - Web Archive Profiling
 
Web Archiving: A Brief Introduction
Web Archiving: A Brief IntroductionWeb Archiving: A Brief Introduction
Web Archiving: A Brief Introduction
 
TPDL 2015 - Profiling Web Archives
TPDL 2015 - Profiling Web ArchivesTPDL 2015 - Profiling Web Archives
TPDL 2015 - Profiling Web Archives
 
Profiling Web Archives
Profiling Web ArchivesProfiling Web Archives
Profiling Web Archives
 
Improving Accessibility of Archived Raster Dictionaries of Complex Script Lan...
Improving Accessibility of Archived Raster Dictionaries of Complex Script Lan...Improving Accessibility of Archived Raster Dictionaries of Complex Script Lan...
Improving Accessibility of Archived Raster Dictionaries of Complex Script Lan...
 
Profile Serialization IIPC GA 2015
Profile Serialization IIPC GA 2015Profile Serialization IIPC GA 2015
Profile Serialization IIPC GA 2015
 

Kürzlich hochgeladen

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Kürzlich hochgeladen (20)

WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Introducing Docker - Application Containerization & Service Orchestration

  • 1. Introducing Docker Application Containerization & Service Orchestration Sawood Alam <@ibnesayeed> Old Dominion University Norfolk, Virginia - 23529 (USA)
  • 2. Dockerizing ArchiveSpark A 30 minutes of Pair Hacking made running a complex software as easy as: $ docker run -p 8888:8888 ibnesayeed/archivespark https://ws-dl.blogspot.com/2016/07/2016-07-21-dockerizing-archivespark.html Read the full story at:
  • 3. Relatables ● The Magic Laptop problem ● Wish, these researchers document their code ● Cannot upgrade X to run Y because Z will break ● This project is the spaghetti of a dozen different technologies ● Yay! Got new machine :-) … Wait! I need to install & configure everything again ;-( ● Too many VMs to manage
  • 4. What Is Docker? ● An application container ● Packages dependencies ● Isolates applications ● Processes run on the host OS ● Uses Linux cgroups and namespaces ● Lighter than a virtual machine ● Open-source Host OS Host OS Docker Engine Bins/Libs App B Bins/Libs App A Container
  • 6. AUFS file1 file2 file2 file3 file4 file1 file3 file1 file2 file3 file4 file5 Image Base Layer Image Layer 1 Image Layer 2 Container Layer More Layers ...
  • 7. Link Extractor Script #!/usr/bin/env python import sys import requests from bs4 import BeautifulSoup res = requests.get(sys.argv[-1]) soup = BeautifulSoup(res.text, "html.parser") for link in soup.find_all("a"): print(link.get("href")) linkextractor.py ● Is it executable? ● Is Python installed? ● Are necessary libraries installed? ● Can you install needed software?
  • 8. Dockerized Link Extractor Script #!/usr/bin/env python import sys import requests from bs4 import BeautifulSoup res = requests.get(sys.argv[-1]) soup = BeautifulSoup(res.text, "html.parser") for link in soup.find_all("a"): print(link.get("href")) FROM python LABEL maintainer="Sawood Alam <@ibnesayeed>" RUN pip install beautifulsoup4 RUN pip install requests COPY linkextractor.py /app/ WORKDIR /app RUN chmod a+x linkextractor.py ENTRYPOINT ["./linkextractor.py"] linkextractor.py Dockerfile
  • 9. Try It me@thishost$ ls >> Dockerfile main.py # Build an image from the Dockerfile (change "ibnesayeed" with your Docker ID) me@thishost$ docker image build -t ibnesayeed/linkextractor . >> Layered docker image... # Run a container from the locally built image me@thishost$ docker container run ibnesayeed/linkextractor https://odu.edu/ >> Extracted links… # Push the image to the registry me@thishost$ docker image push ibnesayeed/linkextractor # Log in to a different host me@thishost$ ssh you@otherhost # Run a container on the other host using the image in the registry you@otherhost$ docker container run ibnesayeed/linkextractor https://example.com/ >> Pull the image from the registry (if not cached already) >> Extracted links...
  • 10. Orchestration Demo Web App API Server Live Web Redis Cache https://github.com/ibnesayeed/linkextractor
  • 11. Useful Links ● https://github.com/ibnesayeed/linkextractor ● https://docs.docker.com/ ● http://training.play-with-docker.com/ ● https://ws-dl.blogspot.com/ ● https://ws-dl.blogspot.com/2016/07/2016-07-21-dockerizing-archivespark.html Sawood Alam <@ibnesayeed>