SlideShare uma empresa Scribd logo
1 de 79
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Zookeeper Introduce
Zookeeper IntroduceZookeeper Introduce
Zookeeper Introducejhao 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, 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 IDavid 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 KernelOpenVZ
 
Docker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityDocker, Linux Containers (LXC), and security
Docker, Linux Containers (LXC), and securityJé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 SecurityPhil Estes
 
container crash course
container crash coursecontainer crash course
container crash courseAndrew 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 DockerPhil 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 | CloudxLabCloudxLab
 
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 HDFSAndré Oriani
 
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 containersKernel TLV
 

Mais procurados (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
 

Semelhante a Docker: Containers for Data Science

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 ContainersBlueData, Inc.
 
Demystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data ScientistsDemystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data ScientistsDr 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 openshiftYusuf Hadiwinata Sutandar
 
Dockers and kubernetes
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetesDr Ganesh Iyer
 
Containers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container ServicesContainers and Nutanix - Acropolis Container Services
Containers and Nutanix - Acropolis Container ServicesNEXTtour
 
(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 2014Amazon 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 KubernetesObjectRocket
 
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 2015Datadog
 
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 WebinarTravis 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 virtualizationKyle Hailey
 
Running & Monitoring Docker at Scale
Running & Monitoring Docker at ScaleRunning & Monitoring Docker at Scale
Running & Monitoring Docker at ScaleDatadog
 

Semelhante a 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 & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
 
Docker and-daily-devops
Docker and-daily-devopsDocker and-daily-devops
Docker and-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
 

Último

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 

Último (20)

Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

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