6. What’s that whale named
Docker ?
"Docker allows you to package an application with all of its dependencies into a
standardised unit for software development."
7. A little bit more Docker
• Dockerfile
!
FROM ubuntu:14.04!
RUN pip install requests!
ADD . /awesome-code!
WORKDIR /awesome-code!
CMD python revolutionary_app.py
$ docker build -t=“your-awesome-image:v1” .
$ docker run -d -p 80:5000 —name container-name your-awesome-image:v1
$ docker push your-awesome-image:v1
$ docker pull myregistry.com:8080/your-awesome-image:v1
$ docker ps!
!
$ docker inspect <container-name/ID>!
!
$ docker log <container-name/ID>!
!
$ docker stop <container-name/ID>!
!
$ docker exec -it <container-name/ID> your_command!
8. Simplified Use Case
• Streaming data from different sources - Twitter,
FB, feeds and customised scraping engine.
• Different processing engines
• Fast iterations over new requirements
• Resilient system with focus over easy
deployment
9. Use case - News Articles
• Trending news articles from
different domains
• News Categorisation
• Relevant news over search
query
• Traffic of news content
fluctuates - pretty dynamic.
• There is no universal right
answer
10. System Design (1)
Data
Stream
Processing
Engine
Processed
Data
(Redis)
$ docker run -d —-name processed_data redismaster:v1 redis-server
$ docker build -t=“redismaster:v1” .
$ docker build -t=“datastream:twitter” .
$ docker run -d —-name twitter_queue datastream:twitter python /code/format_data.py
$ docker build -t —-name processing_engine .!
$ docker run -d —-name magic_powerhouse —-link processed_data:db processing_engine python /code/
magic_script.py
16. Key points: Design &
Development
• Micro - Services oriented design and henceforth
development
• Old/new components can be realised in form of
docker containers
• Different containers can readily interact among
each other
• Ease to test (Local environment) and no worries if
it bursts out in production.
17. Deployment
• Just install docker on remote (to be done with
care)
• Docker images can be pushed to remote
repository (better say registry).
• Make your instances autoscale in any cloud IaaS.
• If instance go down, then new instance just pull
docker images, and start docker containers.
18. Resources
• Docker - https://www.docker.com/whatisdocker
• Boot2docker - https://docs.docker.com/installation/mac/
• Docker-compose - https://docs.docker.com/compose/
• Very short video about Docker (American Style) - https://
www.youtube.com/watch?v=aLipr7tTuA4 - American style
• https://www.youtube.com/watch?v=FdkNAjjO5yQ - Good
resource to have a little deep insight about Containers