SlideShare a Scribd company logo
Using Docker to develop
NAS application
Terry Chen
About me
● Backend engineer : Java, Python, Linux
● QNAP Container Station/Linux Station
https://www.linkedin.com/in/seterrychen
https://github.com/seterrychen
https://twitter.com/seterrychen
Outline
● Introduce basic knowledge of Docker
● Using Docker to deploy NAS applications
What is container?
From : Macmillan Dictionary
What is container?
From : Macmillan Dictionary From : http://www.containerhireaust.com.au/containers/20-foot-general-purpose/
Before container
From:https://en.wikipedia.org/wiki/Stevedore
With container
From : http://pointful.github.io/docker-intro/#/6
Other key property of container
Isolation
Deploy software
From : https://goo.gl/YIKVMJ
http://www.hive-io.com/virtual-server-infrastructure/
Development Environment Production Environment
Application stack
OS Kernel
System libraries
Language runtime
Application code
Configuration
Container concept in software engineering
From : http://www.vccoaching.com/smarter-thinking/
http://pclosmag.com/html/Issues/201304/page08.html
OS Kernel
System libraries
Language runtime
Application code
Configuration
Virtual machine
OS Kernel
System libraries
Language runtime
Application code
Configuration
Linux Container (LXC)
OS Kernel
System
libraries
Language
runtime
Application
code
Configuration
System
libraries
Language
runtime
Application
code
Configuration
System
libraries
Language
runtime
Application
code
Configuration
System libraries
Language runtime
Application code
Configuration
VM vs container
Basic isolation of Linux
● chroot : A chroot on Unix operating systems is an operation that changes the
apparent root directory for the current running process and its children.
From : http://freedompenguin.com/articles/how-to/learning-the-linux-file-system/
DEMO
Isolation of LXC
● Linux Kernel feature :
○ Namespaces
■ Mount namespaces
■ UTS namespaces
■ IPC namespaces
■ PID namespaces
■ Network namespaces
■ User namespaces
Tools of LXC
● lxc-create : download base rootfs and create a container
● lxc-start, lxc-stop … : control the container
● lxc-attach : start a process inside a running container
● lxc-ls : list all containers status
DEMO
Pain point when using LXC (in my case)
● Install your application by script
● Deploy containers by manual
● No version control system/repositories to store containers you already install
application
From : http://icons.iconarchive.com/icons/babasse/imod/72/Tar-icon.png
Host 1 Host 2
container-v1.0 container-v2.0 container-v3.0 container-v1.0 container-v1.1
教練,我只想運作我的程式!!
What is Docker ?
Docker is an open-source engine which automates the deployment of applications
as highly portable, self-sufficient containers.
(From : https://github.com/docker/docker/wiki/Docker-0.3.0-release-note,-May-6-2013)
Docker and Linux
From : https://en.wikipedia.org/wiki/Docker_(software)
Docker power
From : https://yq.aliyun.com/articles/32071
Dockerfile
Dockerfile
FROM alpine:3.3
RUN apk add --no-cache nginx
Docker build my-nginx:0.1 image
FROM alpine:3.3
RUN apk add --no-cache nginx
Docker build my-nginx:0.1 image
FROM alpine:3.3
RUN apk add --no-cache nginx
From : http://thepapist.org/ask-a-question/
Layers of My-nginx image (Docker version 1.9)
0dcd4549ae28 4.797 MB
ff2b369bf5c3 1.454 MB
Image : my-nginx:0.1
FROM alpine:3.3
RUN apk add --no-cache nginx
Docker image / container
0dcd4549ae28 4.797 MB
ff2b369bf5c3 1.454 MB
Image : my-nginx:0.1
Container
mount
AUFS – Another Union File System
From : https://docs.docker.com/engine/userguide/storagedriver/aufs-driver/
DEMO
Process inside container
my-nginx container
nginx: master process
nginx: worker process
PID 1
host
nginx: master process
nginx: worker process
PID 5566
Stop container
my-nginx container
nginx: master process
nginx: worker process
Send SIGTERM
Install dockerized application by qpkg
● For example : Redmine ( docker-qdk2 )
├── icons
├── package_routines
├── qpkg.cfg
├── shared
│ ├── docker-compose.yml
│ ├── redmine.conf
│ └── redmine.sh
└── x86_64
docker-compose
postgresql:
image: sameersbn/postgresql:9.4-11
environment:
- DB_USER=redmine
- DB_PASS=password
- DB_NAME=redmine_production
redmine:
image: sameersbn/redmine:3.2.0-1
links:
- postgresql:postgresql
environment:
- REDMINE_PORT=10083
- REDMINE_RELATIVE_URL_ROOT=/redmine
ports:
- "127.0.0.1:10083:80"
Redmine.conf
ProxyRequests off
ProxyPass /redmine/ http://127.0.0.1:10083/redmine/
ProxyPassReverse /redmine/ http://127.0.0.1:10083/redmine/
Package_routines
pkg_post_install() {
…..
DEPEND_ON=container-station
/sbin/setcfg $QPKG_NAME depend_on "${DEPEND_ON}" -f /etc/config/qpkg.conf
/sbin/log_tool -t0 -uSystem -p127.0.0.1 -mlocalhost -a "[$QPKG_NAME] Start installation"
$CONTAINER_STATION/bin/qbus post com.qnap.dqpkg/qpkg '{"qpkg": "'$QPKG_NAME'",
"action": "install"}'
}
Container Station API
● Version V1.6.1600
DEMO
Common questions
Q: Can skip the initialization of Container Station ?
A: Using system-docker
Common questions
Q: Why is a container suddenly closed after executing docker run ?
A: The PID 1 process inside container is closed. Please using bash replace the
default command to debug.
Common questions
Q: How to backup data of a container
A: Using docker run -v /host_path/backup:/container_path/data
Common questions
Q: At container, how to get information of NAS
A: Using docker -v /host/your_socket:/container/run.
Example : -v /etc/qbus:/etc/qbus -v /var/run/qbus.sock:/var/run/qbus.sock -v
/share/CACHEDEV2_DATA/.qpkg/container-station/usr/bin/.libs/qbus:/bin/qbus
Common questions
Q: How to learn Docker ?
A: Docker Docs is your friend!
From : http://9gag.com/gag/anYZ9Eo/my-code-works-but-i-don-t-know-why
From: http://blog.octanner.com/wp-content/uploads/2013/12/thankyou.jpg

More Related Content

PDF
Develop QNAP NAS App by Docker
PDF
Docker 初探,實驗室中的運貨鯨
PDF
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
PDF
Использование Docker в CI / Александр Акбашев (HERE Technologies)
PPTX
QNAP COSCUP Container Station
PDF
[DockerCon 2019] Hardening Docker daemon with Rootless mode
PDF
Docker 導入:障礙與對策
PDF
Docker All The Things - ASP.NET 4.x and Windows Server Containers
Develop QNAP NAS App by Docker
Docker 初探,實驗室中的運貨鯨
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Использование Docker в CI / Александр Акбашев (HERE Technologies)
QNAP COSCUP Container Station
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Docker 導入:障礙與對策
Docker All The Things - ASP.NET 4.x and Windows Server Containers

What's hot (20)

PDF
Dockerize your Symfony application - Symfony Live NYC 2014
PDF
Docker and DevOps --- new IT culture
PDF
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
PPTX
PHP development with Docker
PDF
Securing Containers, One Patch at a Time - Michael Crosby, Docker
PDF
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
PPTX
Deploying Symfony2 app with Ansible
PDF
Docker 101 - from 0 to Docker in 30 minutes
PDF
手把手帶你學Docker 03042017
PDF
DCSF 19 Deploying Rootless buildkit on Kubernetes
PDF
Docker + Microservices in Production
PDF
Continuous Integration: SaaS vs Jenkins in Cloud
PDF
Perspectives on Docker
PPTX
Learn docker in 90 minutes
PDF
Using Docker in the Real World
PPTX
Docker for Java developers at JavaLand
PPTX
Docker for Developers - Sunshine PHP
PDF
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
PPTX
Docker orchestration
Dockerize your Symfony application - Symfony Live NYC 2014
Docker and DevOps --- new IT culture
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
PHP development with Docker
Securing Containers, One Patch at a Time - Michael Crosby, Docker
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
Deploying Symfony2 app with Ansible
Docker 101 - from 0 to Docker in 30 minutes
手把手帶你學Docker 03042017
DCSF 19 Deploying Rootless buildkit on Kubernetes
Docker + Microservices in Production
Continuous Integration: SaaS vs Jenkins in Cloud
Perspectives on Docker
Learn docker in 90 minutes
Using Docker in the Real World
Docker for Java developers at JavaLand
Docker for Developers - Sunshine PHP
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
Docker orchestration
Ad

Viewers also liked (20)

PDF
georchestra SDI: Project Status Report
PPTX
moscmy2016: Extending Docker
PDF
Introduction to Docker - Learning containerization XP conference 2016
PDF
Docker for the Brave
PPTX
Containers for sensor web services, applications and research @ Sensor Web Co...
PPTX
Hybrid Mobile Development with Apache Cordova and
PDF
Docker Dhahran Nov 2016 meetup
PDF
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
PPTX
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
PPTX
Building a private CI/CD pipeline with Java and Docker in the Cloud as presen...
PDF
Docker introduction
PDF
Advanced Docker Developer Workflows on MacOS X and Windows
PDF
Jelastic - DevOps for Java with Docker Containers - Madrid 2015
PDF
Docker and java
PPTX
Top 50 java ee 7 best practices [con5669]
PDF
Ionic framework one day training
PPTX
Formwork
PPTX
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
PDF
Microservices Minus the Hype: How to Build and Why
PPTX
Docker and java, at Montréal JUG
georchestra SDI: Project Status Report
moscmy2016: Extending Docker
Introduction to Docker - Learning containerization XP conference 2016
Docker for the Brave
Containers for sensor web services, applications and research @ Sensor Web Co...
Hybrid Mobile Development with Apache Cordova and
Docker Dhahran Nov 2016 meetup
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Building a private CI/CD pipeline with Java and Docker in the Cloud as presen...
Docker introduction
Advanced Docker Developer Workflows on MacOS X and Windows
Jelastic - DevOps for Java with Docker Containers - Madrid 2015
Docker and java
Top 50 java ee 7 best practices [con5669]
Ionic framework one day training
Formwork
50 EJB 3 Best Practices in 50 Minutes - JavaOne 2014
Microservices Minus the Hype: How to Build and Why
Docker and java, at Montréal JUG
Ad

Similar to Using docker to develop NAS applications (20)

PPTX
Dockerizing a Symfony2 application
PDF
Docker From Scratch
PDF
The ABC of Docker: The Absolute Best Compendium of Docker
PPTX
Getting Started with Docker
PDF
Dockercon 23 - Getting started with Docker
PPTX
Real World Experience of Running Docker in Development and Production
PDF
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
PPTX
Novices guide to docker
PDF
[@NaukriEngineering] Docker 101
PDF
How Reconnix Is Using Docker
PDF
Journey to the devops automation with docker kubernetes and openshift
PPTX
Docker for dev
PPTX
Docker - Demo on PHP Application deployment
PDF
Docker presentation | Paris Docker Meetup
PDF
Victor Vieux at Docker Paris Meetup #1
PDF
Docker handons-workshop-for-charity
PDF
Cloud Native Computing - Part III - Containers
PPTX
Primi passi con Docker - ItalianCoders - 12-01-2021
PDF
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
PDF
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
Dockerizing a Symfony2 application
Docker From Scratch
The ABC of Docker: The Absolute Best Compendium of Docker
Getting Started with Docker
Dockercon 23 - Getting started with Docker
Real World Experience of Running Docker in Development and Production
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
Novices guide to docker
[@NaukriEngineering] Docker 101
How Reconnix Is Using Docker
Journey to the devops automation with docker kubernetes and openshift
Docker for dev
Docker - Demo on PHP Application deployment
Docker presentation | Paris Docker Meetup
Victor Vieux at Docker Paris Meetup #1
Docker handons-workshop-for-charity
Cloud Native Computing - Part III - Containers
Primi passi con Docker - ItalianCoders - 12-01-2021
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 

Recently uploaded (20)

PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
AI in Product Development-omnex systems
PDF
Nekopoi APK 2025 free lastest update
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
System and Network Administration Chapter 2
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
medical staffing services at VALiNTRY
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
top salesforce developer skills in 2025.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
ai tools demonstartion for schools and inter college
PDF
Digital Strategies for Manufacturing Companies
PPTX
Operating system designcfffgfgggggggvggggggggg
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
AI in Product Development-omnex systems
Nekopoi APK 2025 free lastest update
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
System and Network Administration Chapter 2
2025 Textile ERP Trends: SAP, Odoo & Oracle
Softaken Excel to vCard Converter Software.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Navsoft: AI-Powered Business Solutions & Custom Software Development
Upgrade and Innovation Strategies for SAP ERP Customers
How to Migrate SBCGlobal Email to Yahoo Easily
medical staffing services at VALiNTRY
ManageIQ - Sprint 268 Review - Slide Deck
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
top salesforce developer skills in 2025.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
ai tools demonstartion for schools and inter college
Digital Strategies for Manufacturing Companies
Operating system designcfffgfgggggggvggggggggg

Using docker to develop NAS applications