SlideShare a Scribd company logo
Docker: Containers for Data Science
Ph.D. Alessandro Adamo
alessandro.adamo@gmail.com
June 18, 2017
Data Science Development and
Deployment
Data Science Lifecycle
The Team Data Science Process lifecycle consist of the
following steps:
1
Data Science Lifecycle
The Team Data Science Process lifecycle consist of the
following steps:
• Business Understanding
1
Data Science Lifecycle
The Team Data Science Process lifecycle consist of the
following steps:
• Business Understanding
• Data Acquisition and Understanding
• Data ingestion
• Data exploration
• Set up data pipeline
1
Data Science Lifecycle
The Team Data Science Process lifecycle consist of the
following steps:
• Business Understanding
• Data Acquisition and Understanding
• Data ingestion
• Data exploration
• Set up data pipeline
• Modeling
• Feature engineering
• Model training
1
Data Science Lifecycle
The Team Data Science Process lifecycle consist of the
following steps:
• Business Understanding
• Data Acquisition and Understanding
• Data ingestion
• Data exploration
• Set up data pipeline
• Modeling
• Feature engineering
• Model training
• Deployment
• Operationalize a model: deploy the model and pipeline to a
production or production-like environment for application
consumption.
1
Data Science Lifecycle
The Team Data Science Process lifecycle consist of the
following steps:
• Business Understanding
• Data Acquisition and Understanding
• Data ingestion
• Data exploration
• Set up data pipeline
• Modeling
• Feature engineering
• Model training
• Deployment
• Operationalize a model: deploy the model and pipeline to a
production or production-like environment for application
consumption.
• Customer Acceptance
1
Challenges in Data Science
Data science life cycle highlight some challenges:
2
Challenges in Data Science
Data science life cycle highlight some challenges:
• Download and install libraries
2
Challenges in Data Science
Data science life cycle highlight some challenges:
• Download and install libraries
• Manage versions and dependencies
2
Challenges in Data Science
Data science life cycle highlight some challenges:
• Download and install libraries
• Manage versions and dependencies
• Upgrade libraries
2
Challenges in Data Science
Data science life cycle highlight some challenges:
• Download and install libraries
• Manage versions and dependencies
• Upgrade libraries
• Isolate dependencies between projects
2
Containirezation
Containers come with many very attractive benefits for
developers, data science team and operations teams.
3
Containirezation
Containers come with many very attractive benefits for
developers, data science team and operations teams.
• Abstraction of the host system away from the containerized
application
3
Containirezation
Containers come with many very attractive benefits for
developers, data science team and operations teams.
• Abstraction of the host system away from the containerized
application
• Easy Scalability
3
Containirezation
Containers come with many very attractive benefits for
developers, data science team and operations teams.
• Abstraction of the host system away from the containerized
application
• Easy Scalability
• Simple Dependency Management and Application Versioning
3
Containirezation
Containers come with many very attractive benefits for
developers, data science team and operations teams.
• Abstraction of the host system away from the containerized
application
• Easy Scalability
• Simple Dependency Management and Application Versioning
• Extremely lightweight, isolated execution environments
3
Containirezation
Containers come with many very attractive benefits for
developers, data science team and operations teams.
• Abstraction of the host system away from the containerized
application
• Easy Scalability
• Simple Dependency Management and Application Versioning
• Extremely lightweight, isolated execution environments
• Shared Layering
3
Containirezation
Containers come with many very attractive benefits for
developers, data science team and operations teams.
• Abstraction of the host system away from the containerized
application
• Easy Scalability
• Simple Dependency Management and Application Versioning
• Extremely lightweight, isolated execution environments
• Shared Layering
• Composability and Predictability
3
Containirezation in Data Science
Containirezation solve a many problems simultaneously:
• They make easy to use libraries with complicated setups
• CPU version vs. GPU version (eg. Tensorflow)
• Different enviromets (eg. Python 2 vs. Python 3)
• Etc...
4
Containirezation in Data Science
Containirezation solve a many problems simultaneously:
• They make easy to use libraries with complicated setups
• CPU version vs. GPU version (eg. Tensorflow)
• Different enviromets (eg. Python 2 vs. Python 3)
• Etc...
• They make an output reproducible
4
Containirezation in Data Science
Containirezation solve a many problems simultaneously:
• They make easy to use libraries with complicated setups
• CPU version vs. GPU version (eg. Tensorflow)
• Different enviromets (eg. Python 2 vs. Python 3)
• Etc...
• They make an output reproducible
• They make easy the prototyping and deploy of complex
algorithms
4
Containirezation in Data Science
Containirezation solve a many problems simultaneously:
• They make easy to use libraries with complicated setups
• CPU version vs. GPU version (eg. Tensorflow)
• Different enviromets (eg. Python 2 vs. Python 3)
• Etc...
• They make an output reproducible
• They make easy the prototyping and deploy of complex
algorithms
• They can make easy and isolated the Python / R / Scala
data science development enviroments.
4
Containerization vs Virtualization
Virtual Machines (VMs)
• Represents hardware-level
virtualization
• Heavyweight
• Slow provisioning
• Limited performance
• Fully isolated and hence
more secure
5
Containerization vs Virtualization
Virtual Machines (VMs)
• Represents hardware-level
virtualization
• Heavyweight
• Slow provisioning
• Limited performance
• Fully isolated and hence
more secure
Containers
• Represents operating
system virtualization
• Lightweight
• Real-time provisioning and
scalability
• Native performance
• Process-level isolation and
hence less secure
5
Docker and Containerization
Figure 1: Containers isolate individual applications and use operating
system resources that have been abstracted by Docker. Containers can
be built by ”layering”, with multiple containers sharing underlying layers,
decreasing resource usage.
6
Docker Containers for Data Science:
Practical Session
Run a Docker container
Docker runs processes in isolated containers. The docker run
command must specify an image to derive the container from. An
image developer can define image defaults related to:
7
Run a Docker container
Docker runs processes in isolated containers. The docker run
command must specify an image to derive the container from. An
image developer can define image defaults related to:
• Detached or foreground running
• Container identification
• Network settings
• Runtime constraints on CPU and memory
7
Interactive and Detached mode
Docker support two different running mode: interactive and
detached
8
Interactive and Detached mode
Docker support two different running mode: interactive and
detached
Interactive mode
$ sudo docker run -t -i --name mycontainer
alessandroadamo/ubuntu-ds-python3 /bin/bash
NB. To exit from an interactive container type exit command.
8
Interactive and Detached mode
Docker support two different running mode: interactive and
detached
Interactive mode
$ sudo docker run -t -i --name mycontainer
alessandroadamo/ubuntu-ds-python3 /bin/bash
NB. To exit from an interactive container type exit command.
Detached mode
$ sudo docker run -t -d -p 8888:8888
-v /home/user/notebooks:/home/ds/notebooks
--name mycontainer-daemon
alessandroadamo/ubuntu-ds-python3 8
List Containers
To list informations about the containers status we use the docker
ps.
Running containers
$ sudo docker ps
9
List Containers
To list informations about the containers status we use the docker
ps.
Running containers
$ sudo docker ps
Interactive mode
$ sudo docker ps -a
9
List Containers
To list informations about the containers status we use the docker
ps.
Running containers
$ sudo docker ps
Interactive mode
$ sudo docker ps -a
Latest container
$ sudo docker ps -l
9
List Containers
To list informations about the containers status we use the docker
ps.
Running containers
$ sudo docker ps
Interactive mode
$ sudo docker ps -a
Latest container
$ sudo docker ps -l
List quiet
$ sudo docker ps -q
9
Start and Stop Containers
Start a container
$ sudo docker start
mycontainer
10
Start and Stop Containers
Start a container
$ sudo docker start
mycontainer
Stop a container
$ sudo docker stop
mycontainer
10
Start and Stop Containers
Start a container
$ sudo docker start
mycontainer
Stop a container
$ sudo docker stop
mycontainer
Attach to a running container
$ sudo docker attach
mycontainer
10
Start and Stop Containers
Start a container
$ sudo docker start
mycontainer
Stop a container
$ sudo docker stop
mycontainer
Attach to a running container
$ sudo docker attach
mycontainer
Detach from a running
container
[ Ctrl + C ]
10
Remove Containers
Remove a stopped container
$ sudo docker rm mycontainer
11
Remove Containers
Remove a stopped container
$ sudo docker rm mycontainer
Remove all containers
$ sudo docker rm -f $(sudo docker -a -q)
11
Create your own Docker Image!
Building Process
• Docker can build images automatically by reading the
instructions from a Dockerfile.
• A Dockerfile is a text document that contains all the
commands a user could call on the command line to assemble
an image.
• Using docker build users can create an automated build that
executes several command-line instructions in succession.
12
Dockerfile
Dockerfile
And now an example of minimal Ubuntu Linux Docker image:
13
Dockerfile
Dockerfile
And now an example of minimal Ubuntu Linux Docker image:
FROM ubuntu:16.04
MAINTAINER Alessandro Adamo "alessandro.adamo@gmail.com"
ENV REFRESHED_AT 2017-06-15
RUN apt-get update && apt-get dist-upgrade
13
Dockerfile Commands 1 / 3
Enviroment Variable
ENV <key> <value>
ENV <key> = <value>
14
Dockerfile Commands 1 / 3
Enviroment Variable
ENV <key> <value>
ENV <key> = <value>
Working Directory
WORKDIR ${foo}
14
Dockerfile Commands 1 / 3
Enviroment Variable
ENV <key> <value>
ENV <key> = <value>
Working Directory
WORKDIR ${foo}
Change User
USER username
14
Dockerfile Commands 1 / 3
Enviroment Variable
ENV <key> <value>
ENV <key> = <value>
Working Directory
WORKDIR ${foo}
Change User
USER username
Run a Command in new
Layer
RUN ["executable",
"param1", "param2"]
14
Dockerfile Commands 1 / 3
Enviroment Variable
ENV <key> <value>
ENV <key> = <value>
Working Directory
WORKDIR ${foo}
Change User
USER username
Run a Command in new
Layer
RUN ["executable",
"param1", "param2"]
Default for Container
CMD ["executable",
"param1","param2"]
14
Dockerfile Commands 1 / 3
Enviroment Variable
ENV <key> <value>
ENV <key> = <value>
Working Directory
WORKDIR ${foo}
Change User
USER username
Run a Command in new
Layer
RUN ["executable",
"param1", "param2"]
Default for Container
CMD ["executable",
"param1","param2"]
Metadata
LABEL version="1.0"
14
Dockerfile Commands 2 / 3
Maintainer (Deprecated)
MAINTAINER <name>
15
Dockerfile Commands 2 / 3
Maintainer (Deprecated)
MAINTAINER <name>
Expose a Port
EXPOSE <port> [<port>...]
15
Dockerfile Commands 2 / 3
Maintainer (Deprecated)
MAINTAINER <name>
Expose a Port
EXPOSE <port> [<port>...]
Copy new files
ADD ["<src>",... "<dest>"]
15
Dockerfile Commands 2 / 3
Maintainer (Deprecated)
MAINTAINER <name>
Expose a Port
EXPOSE <port> [<port>...]
Copy new files
ADD ["<src>",... "<dest>"]
Copy files
COPY ["<src>",... "<dest>"]
15
Dockerfile Commands 2 / 3
Maintainer (Deprecated)
MAINTAINER <name>
Expose a Port
EXPOSE <port> [<port>...]
Copy new files
ADD ["<src>",... "<dest>"]
Copy files
COPY ["<src>",... "<dest>"]
Run image as Executable
ENTRYPOINT ["executable",
"param1", "param2"]
15
Dockerfile Commands 2 / 3
Maintainer (Deprecated)
MAINTAINER <name>
Expose a Port
EXPOSE <port> [<port>...]
Copy new files
ADD ["<src>",... "<dest>"]
Copy files
COPY ["<src>",... "<dest>"]
Run image as Executable
ENTRYPOINT ["executable",
"param1", "param2"]
Mount Point
VOLUME ["/data"]
15
Dockerfile Commands 3 / 3
Arguments)
ARG <name>[=<default value>]
16
Dockerfile Commands 3 / 3
Arguments)
ARG <name>[=<default value>]
On Build
ONBUILD [INSTRUCTION]
16
Dockerfile Commands 3 / 3
Arguments)
ARG <name>[=<default value>]
On Build
ONBUILD [INSTRUCTION]
Stop Signal
STOPSIGNAL signal
16
Dockerfile Commands 3 / 3
Arguments)
ARG <name>[=<default value>]
On Build
ONBUILD [INSTRUCTION]
Stop Signal
STOPSIGNAL signal
Test a Container
HEALTHCHECK [OPTIONS]
CMD command
HEALTHCHECK NONE
16
Dockerfile Commands 3 / 3
Arguments)
ARG <name>[=<default value>]
On Build
ONBUILD [INSTRUCTION]
Stop Signal
STOPSIGNAL signal
Test a Container
HEALTHCHECK [OPTIONS]
CMD command
HEALTHCHECK NONE
Default Shell
SHELL ["executable",
"parameters"]
16
Build the Image
17
Build the Image
Build the Image
$ docker build
-t alessandroadamo/ubuntu-ds-pyhon3 .
17
Build the Image
Build the Image
$ docker build
-t alessandroadamo/ubuntu-ds-pyhon3 .
Disable Caching
$ docker build --no-cache
-t alessandroadamo/ubuntu-ds-pyhon3 .
17
Build the Image
Build the Image
$ docker build
-t alessandroadamo/ubuntu-ds-pyhon3 .
Disable Caching
$ docker build --no-cache
-t alessandroadamo/ubuntu-ds-pyhon3 .
Enable Compression
$ docker build --compress=true
-t alessandroadamo/ubuntu-ds-pyhon3 .
17
And More ...
Not Covered Arguments ...
18
Not Covered Arguments ...
• GitHub / BitBucket and Docker Hub integration
18
Not Covered Arguments ...
• GitHub / BitBucket and Docker Hub integration
• Networking
18
Not Covered Arguments ...
• GitHub / BitBucket and Docker Hub integration
• Networking
• Testing with Docker
18
Not Covered Arguments ...
• GitHub / BitBucket and Docker Hub integration
• Networking
• Testing with Docker
• Comtinuous integration
18
Not Covered Arguments ...
• GitHub / BitBucket and Docker Hub integration
• Networking
• Testing with Docker
• Comtinuous integration
• Building services (Java application server etc.)
18
Not Covered Arguments ...
• GitHub / BitBucket and Docker Hub integration
• Networking
• Testing with Docker
• Comtinuous integration
• Building services (Java application server etc.)
• Container orchestration
18
Not Covered Arguments ...
• GitHub / BitBucket and Docker Hub integration
• Networking
• Testing with Docker
• Comtinuous integration
• Building services (Java application server etc.)
• Container orchestration
• Docker API
18
Thanks
Thanks
Thank You!
19

More Related Content

What's hot

Zookeeper Introduce
Zookeeper IntroduceZookeeper Introduce
Zookeeper Introduce
jhao niu
 
Docker Internals - Twilio talk November 14th, 2013
Docker Internals - Twilio talk November 14th, 2013Docker Internals - Twilio talk November 14th, 2013
Docker Internals - Twilio talk November 14th, 2013Guillaume Charmes
 
Docker allocating resources
Docker allocating resourcesDocker allocating resources
Docker allocating resources
Mohammadreza Amini
 
Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?
Jérôme Petazzoni
 
BDM29: AdamCloud Project - Part I
BDM29: AdamCloud Project - Part IBDM29: AdamCloud Project - Part I
BDM29: AdamCloud Project - Part I
David Lauzon
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux Kernel
OpenVZ
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and security
Jérôme Petazzoni
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)
rajdeep
 
LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?
Jérôme Petazzoni
 
Cgroup resource mgmt_v1
Cgroup resource mgmt_v1Cgroup resource mgmt_v1
Cgroup resource mgmt_v1sprdd
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Phil Estes
 
container crash course
container crash coursecontainer crash course
container crash course
Andrew Shafer
 
Rooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerRooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in Docker
Phil Estes
 
Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)
Ralf Dannert
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班
Paul Chao
 
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
CloudxLab
 
IEEE SRDS'12: From Backup to Hot Standby: High Availability for HDFS
IEEE SRDS'12: From Backup to Hot Standby: High Availability for HDFSIEEE SRDS'12: From Backup to Hot Standby: High Availability for HDFS
IEEE SRDS'12: From Backup to Hot Standby: High Availability for HDFS
André Oriani
 
Cassandra勉強会
Cassandra勉強会Cassandra勉強会
Cassandra勉強会
Shun Nakamura
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
Boden Russell
 
Namespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersNamespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containers
Kernel TLV
 

What's hot (20)

Zookeeper Introduce
Zookeeper IntroduceZookeeper Introduce
Zookeeper Introduce
 
Docker Internals - Twilio talk November 14th, 2013
Docker Internals - Twilio talk November 14th, 2013Docker Internals - Twilio talk November 14th, 2013
Docker Internals - Twilio talk November 14th, 2013
 
Docker allocating resources
Docker allocating resourcesDocker allocating resources
Docker allocating resources
 
Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?Docker, Linux Containers, and Security: Does It Add Up?
Docker, Linux Containers, and Security: Does It Add Up?
 
BDM29: AdamCloud Project - Part I
BDM29: AdamCloud Project - Part IBDM29: AdamCloud Project - Part I
BDM29: AdamCloud Project - Part I
 
Containers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux KernelContainers and Namespaces in the Linux Kernel
Containers and Namespaces in the Linux Kernel
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and security
 
Docker Architecture (v1.3)
Docker Architecture (v1.3)Docker Architecture (v1.3)
Docker Architecture (v1.3)
 
LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?LXC, Docker, security: is it safe to run applications in Linux Containers?
LXC, Docker, security: is it safe to run applications in Linux Containers?
 
Cgroup resource mgmt_v1
Cgroup resource mgmt_v1Cgroup resource mgmt_v1
Cgroup resource mgmt_v1
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
 
container crash course
container crash coursecontainer crash course
container crash course
 
Rooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in DockerRooting Out Root: User namespaces in Docker
Rooting Out Root: User namespaces in Docker
 
Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)Linux containers-namespaces(Dec 2014)
Linux containers-namespaces(Dec 2014)
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班
 
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
 
IEEE SRDS'12: From Backup to Hot Standby: High Availability for HDFS
IEEE SRDS'12: From Backup to Hot Standby: High Availability for HDFSIEEE SRDS'12: From Backup to Hot Standby: High Availability for HDFS
IEEE SRDS'12: From Backup to Hot Standby: High Availability for HDFS
 
Cassandra勉強会
Cassandra勉強会Cassandra勉強会
Cassandra勉強会
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
 
Namespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containersNamespaces and cgroups - the basis of Linux containers
Namespaces and cgroups - the basis of Linux containers
 

Similar to Docker: Containers for Data Science

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)
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
Wyn B. Van Devanter
 
Lessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker ContainersLessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker Containers
BlueData, Inc.
 
Demystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data ScientistsDemystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data Scientists
Dr Ganesh Iyer
 
Journey to the devops automation with docker kubernetes and openshift
Journey to the devops automation with docker kubernetes and openshiftJourney to the devops automation with docker kubernetes and openshift
Journey to the devops automation with docker kubernetes and openshift
Yusuf Hadiwinata Sutandar
 
Docker and-daily-devops
Docker and-daily-devopsDocker and-daily-devops
Docker and-daily-devops
Satria Ady Pradana
 
Docker & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
Satria Ady Pradana
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetes
Dr Ganesh Iyer
 
Containers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container ServicesContainers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container Services
NEXTtour
 
Docker handons-workshop-for-charity
Docker handons-workshop-for-charityDocker handons-workshop-for-charity
Docker handons-workshop-for-charity
Yusuf Hadiwinata Sutandar
 
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
Amazon Web Services
 
Database as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesDatabase as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on Kubernetes
ObjectRocket
 
Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015
Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015
Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015
Datadog
 
Containers 101
Containers 101Containers 101
Containers 101
Black Duck by Synopsys
 
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Lucas Jellema
 
SQL Server in DevOps Town Hall Webinar
SQL Server in DevOps Town Hall WebinarSQL Server in DevOps Town Hall Webinar
SQL Server in DevOps Town Hall Webinar
Travis Wright
 
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Odinot Stanislas
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualization
Kyle Hailey
 
Running & Monitoring Docker at Scale
Running & Monitoring Docker at ScaleRunning & Monitoring Docker at Scale
Running & Monitoring Docker at Scale
Datadog
 

Similar to Docker: Containers for Data Science (20)

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
 
Developer workflow with docker
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with docker
 
Lessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker ContainersLessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker Containers
 
Demystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data ScientistsDemystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data Scientists
 
Journey to the devops automation with docker kubernetes and openshift
Journey to the devops automation with docker kubernetes and openshiftJourney to the devops automation with docker kubernetes and openshift
Journey to the devops automation with docker kubernetes and openshift
 
Docker and-daily-devops
Docker and-daily-devopsDocker and-daily-devops
Docker and-daily-devops
 
Docker & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetes
 
Containers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container ServicesContainers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container Services
 
Docker handons-workshop-for-charity
Docker handons-workshop-for-charityDocker handons-workshop-for-charity
Docker handons-workshop-for-charity
 
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
(APP309) Running and Monitoring Docker Containers at Scale | AWS re:Invent 2014
 
Database as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on KubernetesDatabase as a Service (DBaaS) on Kubernetes
Database as a Service (DBaaS) on Kubernetes
 
Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015
Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015
Docker Usage Patterns - Meetup Docker Paris - November, 10th 2015
 
Containers 101
Containers 101Containers 101
Containers 101
 
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
 
SQL Server in DevOps Town Hall Webinar
SQL Server in DevOps Town Hall WebinarSQL Server in DevOps Town Hall Webinar
SQL Server in DevOps Town Hall Webinar
 
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualization
 
Running & Monitoring Docker at Scale
Running & Monitoring Docker at ScaleRunning & Monitoring Docker at Scale
Running & Monitoring Docker at Scale
 

Recently uploaded

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
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
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
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
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
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
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
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
 
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
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
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
 

Recently uploaded (20)

JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
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
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
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...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
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
 
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
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
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
 
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
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
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...
 

Docker: Containers for Data Science

  • 1. Docker: Containers for Data Science Ph.D. Alessandro Adamo alessandro.adamo@gmail.com June 18, 2017
  • 2. Data Science Development and Deployment
  • 3. Data Science Lifecycle The Team Data Science Process lifecycle consist of the following steps: 1
  • 4. Data Science Lifecycle The Team Data Science Process lifecycle consist of the following steps: • Business Understanding 1
  • 5. Data Science Lifecycle The Team Data Science Process lifecycle consist of the following steps: • Business Understanding • Data Acquisition and Understanding • Data ingestion • Data exploration • Set up data pipeline 1
  • 6. Data Science Lifecycle The Team Data Science Process lifecycle consist of the following steps: • Business Understanding • Data Acquisition and Understanding • Data ingestion • Data exploration • Set up data pipeline • Modeling • Feature engineering • Model training 1
  • 7. Data Science Lifecycle The Team Data Science Process lifecycle consist of the following steps: • Business Understanding • Data Acquisition and Understanding • Data ingestion • Data exploration • Set up data pipeline • Modeling • Feature engineering • Model training • Deployment • Operationalize a model: deploy the model and pipeline to a production or production-like environment for application consumption. 1
  • 8. Data Science Lifecycle The Team Data Science Process lifecycle consist of the following steps: • Business Understanding • Data Acquisition and Understanding • Data ingestion • Data exploration • Set up data pipeline • Modeling • Feature engineering • Model training • Deployment • Operationalize a model: deploy the model and pipeline to a production or production-like environment for application consumption. • Customer Acceptance 1
  • 9. Challenges in Data Science Data science life cycle highlight some challenges: 2
  • 10. Challenges in Data Science Data science life cycle highlight some challenges: • Download and install libraries 2
  • 11. Challenges in Data Science Data science life cycle highlight some challenges: • Download and install libraries • Manage versions and dependencies 2
  • 12. Challenges in Data Science Data science life cycle highlight some challenges: • Download and install libraries • Manage versions and dependencies • Upgrade libraries 2
  • 13. Challenges in Data Science Data science life cycle highlight some challenges: • Download and install libraries • Manage versions and dependencies • Upgrade libraries • Isolate dependencies between projects 2
  • 14. Containirezation Containers come with many very attractive benefits for developers, data science team and operations teams. 3
  • 15. Containirezation Containers come with many very attractive benefits for developers, data science team and operations teams. • Abstraction of the host system away from the containerized application 3
  • 16. Containirezation Containers come with many very attractive benefits for developers, data science team and operations teams. • Abstraction of the host system away from the containerized application • Easy Scalability 3
  • 17. Containirezation Containers come with many very attractive benefits for developers, data science team and operations teams. • Abstraction of the host system away from the containerized application • Easy Scalability • Simple Dependency Management and Application Versioning 3
  • 18. Containirezation Containers come with many very attractive benefits for developers, data science team and operations teams. • Abstraction of the host system away from the containerized application • Easy Scalability • Simple Dependency Management and Application Versioning • Extremely lightweight, isolated execution environments 3
  • 19. Containirezation Containers come with many very attractive benefits for developers, data science team and operations teams. • Abstraction of the host system away from the containerized application • Easy Scalability • Simple Dependency Management and Application Versioning • Extremely lightweight, isolated execution environments • Shared Layering 3
  • 20. Containirezation Containers come with many very attractive benefits for developers, data science team and operations teams. • Abstraction of the host system away from the containerized application • Easy Scalability • Simple Dependency Management and Application Versioning • Extremely lightweight, isolated execution environments • Shared Layering • Composability and Predictability 3
  • 21. Containirezation in Data Science Containirezation solve a many problems simultaneously: • They make easy to use libraries with complicated setups • CPU version vs. GPU version (eg. Tensorflow) • Different enviromets (eg. Python 2 vs. Python 3) • Etc... 4
  • 22. Containirezation in Data Science Containirezation solve a many problems simultaneously: • They make easy to use libraries with complicated setups • CPU version vs. GPU version (eg. Tensorflow) • Different enviromets (eg. Python 2 vs. Python 3) • Etc... • They make an output reproducible 4
  • 23. Containirezation in Data Science Containirezation solve a many problems simultaneously: • They make easy to use libraries with complicated setups • CPU version vs. GPU version (eg. Tensorflow) • Different enviromets (eg. Python 2 vs. Python 3) • Etc... • They make an output reproducible • They make easy the prototyping and deploy of complex algorithms 4
  • 24. Containirezation in Data Science Containirezation solve a many problems simultaneously: • They make easy to use libraries with complicated setups • CPU version vs. GPU version (eg. Tensorflow) • Different enviromets (eg. Python 2 vs. Python 3) • Etc... • They make an output reproducible • They make easy the prototyping and deploy of complex algorithms • They can make easy and isolated the Python / R / Scala data science development enviroments. 4
  • 25. Containerization vs Virtualization Virtual Machines (VMs) • Represents hardware-level virtualization • Heavyweight • Slow provisioning • Limited performance • Fully isolated and hence more secure 5
  • 26. Containerization vs Virtualization Virtual Machines (VMs) • Represents hardware-level virtualization • Heavyweight • Slow provisioning • Limited performance • Fully isolated and hence more secure Containers • Represents operating system virtualization • Lightweight • Real-time provisioning and scalability • Native performance • Process-level isolation and hence less secure 5
  • 27. Docker and Containerization Figure 1: Containers isolate individual applications and use operating system resources that have been abstracted by Docker. Containers can be built by ”layering”, with multiple containers sharing underlying layers, decreasing resource usage. 6
  • 28. Docker Containers for Data Science: Practical Session
  • 29. Run a Docker container Docker runs processes in isolated containers. The docker run command must specify an image to derive the container from. An image developer can define image defaults related to: 7
  • 30. Run a Docker container Docker runs processes in isolated containers. The docker run command must specify an image to derive the container from. An image developer can define image defaults related to: • Detached or foreground running • Container identification • Network settings • Runtime constraints on CPU and memory 7
  • 31. Interactive and Detached mode Docker support two different running mode: interactive and detached 8
  • 32. Interactive and Detached mode Docker support two different running mode: interactive and detached Interactive mode $ sudo docker run -t -i --name mycontainer alessandroadamo/ubuntu-ds-python3 /bin/bash NB. To exit from an interactive container type exit command. 8
  • 33. Interactive and Detached mode Docker support two different running mode: interactive and detached Interactive mode $ sudo docker run -t -i --name mycontainer alessandroadamo/ubuntu-ds-python3 /bin/bash NB. To exit from an interactive container type exit command. Detached mode $ sudo docker run -t -d -p 8888:8888 -v /home/user/notebooks:/home/ds/notebooks --name mycontainer-daemon alessandroadamo/ubuntu-ds-python3 8
  • 34. List Containers To list informations about the containers status we use the docker ps. Running containers $ sudo docker ps 9
  • 35. List Containers To list informations about the containers status we use the docker ps. Running containers $ sudo docker ps Interactive mode $ sudo docker ps -a 9
  • 36. List Containers To list informations about the containers status we use the docker ps. Running containers $ sudo docker ps Interactive mode $ sudo docker ps -a Latest container $ sudo docker ps -l 9
  • 37. List Containers To list informations about the containers status we use the docker ps. Running containers $ sudo docker ps Interactive mode $ sudo docker ps -a Latest container $ sudo docker ps -l List quiet $ sudo docker ps -q 9
  • 38. Start and Stop Containers Start a container $ sudo docker start mycontainer 10
  • 39. Start and Stop Containers Start a container $ sudo docker start mycontainer Stop a container $ sudo docker stop mycontainer 10
  • 40. Start and Stop Containers Start a container $ sudo docker start mycontainer Stop a container $ sudo docker stop mycontainer Attach to a running container $ sudo docker attach mycontainer 10
  • 41. Start and Stop Containers Start a container $ sudo docker start mycontainer Stop a container $ sudo docker stop mycontainer Attach to a running container $ sudo docker attach mycontainer Detach from a running container [ Ctrl + C ] 10
  • 42. Remove Containers Remove a stopped container $ sudo docker rm mycontainer 11
  • 43. Remove Containers Remove a stopped container $ sudo docker rm mycontainer Remove all containers $ sudo docker rm -f $(sudo docker -a -q) 11
  • 44. Create your own Docker Image!
  • 45. Building Process • Docker can build images automatically by reading the instructions from a Dockerfile. • A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image. • Using docker build users can create an automated build that executes several command-line instructions in succession. 12
  • 46. Dockerfile Dockerfile And now an example of minimal Ubuntu Linux Docker image: 13
  • 47. Dockerfile Dockerfile And now an example of minimal Ubuntu Linux Docker image: FROM ubuntu:16.04 MAINTAINER Alessandro Adamo "alessandro.adamo@gmail.com" ENV REFRESHED_AT 2017-06-15 RUN apt-get update && apt-get dist-upgrade 13
  • 48. Dockerfile Commands 1 / 3 Enviroment Variable ENV <key> <value> ENV <key> = <value> 14
  • 49. Dockerfile Commands 1 / 3 Enviroment Variable ENV <key> <value> ENV <key> = <value> Working Directory WORKDIR ${foo} 14
  • 50. Dockerfile Commands 1 / 3 Enviroment Variable ENV <key> <value> ENV <key> = <value> Working Directory WORKDIR ${foo} Change User USER username 14
  • 51. Dockerfile Commands 1 / 3 Enviroment Variable ENV <key> <value> ENV <key> = <value> Working Directory WORKDIR ${foo} Change User USER username Run a Command in new Layer RUN ["executable", "param1", "param2"] 14
  • 52. Dockerfile Commands 1 / 3 Enviroment Variable ENV <key> <value> ENV <key> = <value> Working Directory WORKDIR ${foo} Change User USER username Run a Command in new Layer RUN ["executable", "param1", "param2"] Default for Container CMD ["executable", "param1","param2"] 14
  • 53. Dockerfile Commands 1 / 3 Enviroment Variable ENV <key> <value> ENV <key> = <value> Working Directory WORKDIR ${foo} Change User USER username Run a Command in new Layer RUN ["executable", "param1", "param2"] Default for Container CMD ["executable", "param1","param2"] Metadata LABEL version="1.0" 14
  • 54. Dockerfile Commands 2 / 3 Maintainer (Deprecated) MAINTAINER <name> 15
  • 55. Dockerfile Commands 2 / 3 Maintainer (Deprecated) MAINTAINER <name> Expose a Port EXPOSE <port> [<port>...] 15
  • 56. Dockerfile Commands 2 / 3 Maintainer (Deprecated) MAINTAINER <name> Expose a Port EXPOSE <port> [<port>...] Copy new files ADD ["<src>",... "<dest>"] 15
  • 57. Dockerfile Commands 2 / 3 Maintainer (Deprecated) MAINTAINER <name> Expose a Port EXPOSE <port> [<port>...] Copy new files ADD ["<src>",... "<dest>"] Copy files COPY ["<src>",... "<dest>"] 15
  • 58. Dockerfile Commands 2 / 3 Maintainer (Deprecated) MAINTAINER <name> Expose a Port EXPOSE <port> [<port>...] Copy new files ADD ["<src>",... "<dest>"] Copy files COPY ["<src>",... "<dest>"] Run image as Executable ENTRYPOINT ["executable", "param1", "param2"] 15
  • 59. Dockerfile Commands 2 / 3 Maintainer (Deprecated) MAINTAINER <name> Expose a Port EXPOSE <port> [<port>...] Copy new files ADD ["<src>",... "<dest>"] Copy files COPY ["<src>",... "<dest>"] Run image as Executable ENTRYPOINT ["executable", "param1", "param2"] Mount Point VOLUME ["/data"] 15
  • 60. Dockerfile Commands 3 / 3 Arguments) ARG <name>[=<default value>] 16
  • 61. Dockerfile Commands 3 / 3 Arguments) ARG <name>[=<default value>] On Build ONBUILD [INSTRUCTION] 16
  • 62. Dockerfile Commands 3 / 3 Arguments) ARG <name>[=<default value>] On Build ONBUILD [INSTRUCTION] Stop Signal STOPSIGNAL signal 16
  • 63. Dockerfile Commands 3 / 3 Arguments) ARG <name>[=<default value>] On Build ONBUILD [INSTRUCTION] Stop Signal STOPSIGNAL signal Test a Container HEALTHCHECK [OPTIONS] CMD command HEALTHCHECK NONE 16
  • 64. Dockerfile Commands 3 / 3 Arguments) ARG <name>[=<default value>] On Build ONBUILD [INSTRUCTION] Stop Signal STOPSIGNAL signal Test a Container HEALTHCHECK [OPTIONS] CMD command HEALTHCHECK NONE Default Shell SHELL ["executable", "parameters"] 16
  • 66. Build the Image Build the Image $ docker build -t alessandroadamo/ubuntu-ds-pyhon3 . 17
  • 67. Build the Image Build the Image $ docker build -t alessandroadamo/ubuntu-ds-pyhon3 . Disable Caching $ docker build --no-cache -t alessandroadamo/ubuntu-ds-pyhon3 . 17
  • 68. Build the Image Build the Image $ docker build -t alessandroadamo/ubuntu-ds-pyhon3 . Disable Caching $ docker build --no-cache -t alessandroadamo/ubuntu-ds-pyhon3 . Enable Compression $ docker build --compress=true -t alessandroadamo/ubuntu-ds-pyhon3 . 17
  • 71. Not Covered Arguments ... • GitHub / BitBucket and Docker Hub integration 18
  • 72. Not Covered Arguments ... • GitHub / BitBucket and Docker Hub integration • Networking 18
  • 73. Not Covered Arguments ... • GitHub / BitBucket and Docker Hub integration • Networking • Testing with Docker 18
  • 74. Not Covered Arguments ... • GitHub / BitBucket and Docker Hub integration • Networking • Testing with Docker • Comtinuous integration 18
  • 75. Not Covered Arguments ... • GitHub / BitBucket and Docker Hub integration • Networking • Testing with Docker • Comtinuous integration • Building services (Java application server etc.) 18
  • 76. Not Covered Arguments ... • GitHub / BitBucket and Docker Hub integration • Networking • Testing with Docker • Comtinuous integration • Building services (Java application server etc.) • Container orchestration 18
  • 77. Not Covered Arguments ... • GitHub / BitBucket and Docker Hub integration • Networking • Testing with Docker • Comtinuous integration • Building services (Java application server etc.) • Container orchestration • Docker API 18