SlideShare a Scribd company logo
Python Docker
mypy Playground
Yusuke Miyazaki @ymyzk
PyCon mini Osaka 2018
2018/5/19 Grand Front Osaka
Development of mypy Playground with Python and Docker
• / @ymyzk
• @ / Indeed
• Python 6 + / PyCon JP / …
• ymyzk.com
• : → (2 ) → ( )
• Python Boot Camp in
• IT CAMPHOR-
( )
Python ? 



Python Docker 

mypy Playground
•
• mypy Playground
• Python + Docker mypy
•
•
mypy Playground
mypy ? 🙋
mypy ? 🙋
mypy
• Python
• PEP 484 / 526
• CLI
def greeting(name: str) -> str:
return f"Hello, {name}!!"
greeting("Taro")
greeting(123) # error: Argument 1 to "greeting" has
# incompatible type "int"; expected "str"
mypy Playground: mypy-play.net
• mypy Web
•
• mypy
•
• Gist
mypy Playground: URL HERE
mypy Playground
• mypy
• /tmp/test1.py
•
• mypy typeshed
:
•
• : The Go Playground / Rust Playground / Scastie (Scala)
•
• : Wandbox
• : ymyzk/awesome-playgrounds
mypy Playground

 



UI





 



UI




Ace Bootstrap Bottle Docker
•
• CPU
•
• …
•
•
• import
•
Python + Docker
mypy
Docker ? "
Docker
•
• : jail / LXC / systemd-nspawn
•
• Linux ( cgroups)
•
Docker
•
•
• Docker Hub
•
• Docker
• Docker
Python Docker
• Docker Engine API HTTP API
• CLI docker API
• Python Docker docker-py
• CLI
• docker-py
Python Docker
$ docker run ubuntu echo Hello Osaka!
import docker
client = docker.from_env()

client.containers.run("ubuntu", "echo Hello Osaka!")
mypy
1. mypy Docker
2. mypy
3.
Docker
# typed-ast manylinux1 

FROM python:3.6
RUN pip install mypy
# root
USER nobody
CMD ["mypy"]
c = client.containers.create(
"ymyzk/mypy-playground:sandbox",
command="mypy main.py",
network_mode="none", #
mem_limit="128m", #
pids_limit=32,
cap_drop="ALL",
security_opt=["no-new-privileges"])
# tar (Docker API )
tarball = create_archive(source)
c.put_archive("/tmp", tarball)#
c.start() # mypy
exit_code = c.wait() #
#
stdout = c.logs(stdout=True, stderr=False).decode("utf-8")
stderr = c.logs(stdout=False, stderr=True).decode("utf-8")
c.remove()
• Docker mypy
•
• ?
• :
Python と Docker で mypy Playground を開発した話
Docker in Docker (dind)
• Docker Docker
• Docker 

Docker Docker


Docker in Docker
• Docker
• Docker
• Docker
Docker in Docker
• vfs 

• 

dind
mypy Playground
• I/O
• mypy
• mypy
• WSGI
•
mypy Playground with asyncio
• Bottle Tornado
• Docker asyncio aiodocker
• aiodocker docker-py
Python と Docker で mypy Playground を開発した話
• mypy Playground
•
• typeshed / PEP 561
• Facebook Pyre
• : / dmypy
• Python + Docker mypy Playground (mypy-play.net)
• Web Python
• Docker
• Twitter: @mypy_playground / GitHub: ymyzk/mypy-playground
• !!

More Related Content

PDF
OSS AWS 핸즈온 강의
PPT
Fabric
PPTX
Infra@LINE_Chris
PDF
Pimp my dev box (Friday Training at Itnig)
PDF
Going All-In With Go For CLI Apps
PDF
How to build and distribute CLI tool in 15 minutes with Golang
PPTX
Git - a overview for beginners
PDF
Starting python
OSS AWS 핸즈온 강의
Fabric
Infra@LINE_Chris
Pimp my dev box (Friday Training at Itnig)
Going All-In With Go For CLI Apps
How to build and distribute CLI tool in 15 minutes with Golang
Git - a overview for beginners
Starting python

What's hot (20)

PDF
SwiftyGPIO
PDF
2 docker engine_hands_on
 
PPTX
Docker + Arm - Multi-arch builds with Docker `buildx`
PDF
Build Android OS on OSX
PDF
Why ruby
PDF
Linux containers
PDF
Let's talk about the Ubuntu 18.04 LTS Roadmap!
PDF
Full-stack go with GopherJS
PDF
Git 개념 및 사용법
PDF
Git! Why? How?
PDF
用 Bitbar Tool 寫 Script 自動擷取外幣
PPTX
Ubuntu 17.10
PPTX
PuppetConf 2017: State of Union: Containers at Puppet- Gert Drapers, Puppet
PDF
Ansible PyWAW
PPTX
20160929 android taipei Sonatype nexus on amazon ec2
PDF
Docker 入門 Introduction to Docker
PPT
Collaboration With Git and GitHub
PDF
Complementing Docker with Puppet
PDF
Introduction to Sumatra
PDF
Deis, a PaaS built with Docker, Docker Meetup Sao Paulo #3 @Wayra
SwiftyGPIO
2 docker engine_hands_on
 
Docker + Arm - Multi-arch builds with Docker `buildx`
Build Android OS on OSX
Why ruby
Linux containers
Let's talk about the Ubuntu 18.04 LTS Roadmap!
Full-stack go with GopherJS
Git 개념 및 사용법
Git! Why? How?
用 Bitbar Tool 寫 Script 自動擷取外幣
Ubuntu 17.10
PuppetConf 2017: State of Union: Containers at Puppet- Gert Drapers, Puppet
Ansible PyWAW
20160929 android taipei Sonatype nexus on amazon ec2
Docker 入門 Introduction to Docker
Collaboration With Git and GitHub
Complementing Docker with Puppet
Introduction to Sumatra
Deis, a PaaS built with Docker, Docker Meetup Sao Paulo #3 @Wayra
Ad

Similar to Python と Docker で mypy Playground を開発した話 (20)

PDF
ContainerDayVietnam2016: Django Development with Docker
PDF
Introduction to Docker
PDF
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
PPTX
ABCs of docker
PDF
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
PDF
Docker Demo @ IuK Seminar
PDF
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
PDF
Troubleshooting Tips from a Docker Support Engineer
PDF
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
PDF
Docker, the Future of DevOps
PDF
Shipping python project by docker
PDF
Docker & FieldAware
PDF
Docker tips
PDF
PyCon 2013 : Scripting to PyPi to GitHub and More
PPTX
Pycon Australia 2015: Docker + Python
PDF
Testing with Docker
PDF
Learning Docker with Thomas
PDF
手把手帶你學Docker 03042017
PDF
How to create your own hack environment
PPT
Docker 101, Alexander Ryabtsev
ContainerDayVietnam2016: Django Development with Docker
Introduction to Docker
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
ABCs of docker
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
Docker Demo @ IuK Seminar
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support Engineer - Jeff Anderson, Docker
Docker, the Future of DevOps
Shipping python project by docker
Docker & FieldAware
Docker tips
PyCon 2013 : Scripting to PyPi to GitHub and More
Pycon Australia 2015: Docker + Python
Testing with Docker
Learning Docker with Thomas
手把手帶你學Docker 03042017
How to create your own hack environment
Docker 101, Alexander Ryabtsev
Ad

More from Yusuke Miyazaki (12)

PDF
Dynamic Type Inference for Gradual Hindley–Milner Typing
PDF
Introducing wsgi_lineprof / PyCon JP 2017 LT
PDF
オープンソースソフトウェア入門
PDF
型ヒントについて考えよう!
PDF
iot.ymyzk.com の紹介
PDF
Django から各種チャットツールに通知するライブラリを作った話
PDF
iOS 開発のいま (ADF2015 LT会)
PDF
iOS 開発のいま (CAMPHOR- x KMC 合同LT会)
PDF
Swift の問題点
PDF
最新の iOS に対応したアプリの開発
PDF
コンピューターネットワーク入門
PDF
HTML初心者講座
Dynamic Type Inference for Gradual Hindley–Milner Typing
Introducing wsgi_lineprof / PyCon JP 2017 LT
オープンソースソフトウェア入門
型ヒントについて考えよう!
iot.ymyzk.com の紹介
Django から各種チャットツールに通知するライブラリを作った話
iOS 開発のいま (ADF2015 LT会)
iOS 開発のいま (CAMPHOR- x KMC 合同LT会)
Swift の問題点
最新の iOS に対応したアプリの開発
コンピューターネットワーク入門
HTML初心者講座

Recently uploaded (20)

PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Essential Infomation Tech presentation.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
history of c programming in notes for students .pptx
PDF
System and Network Administration Chapter 2
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Nekopoi APK 2025 free lastest update
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
System and Network Administraation Chapter 3
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Reimagine Home Health with the Power of Agentic AI​
Essential Infomation Tech presentation.pptx
CHAPTER 2 - PM Management and IT Context
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Odoo Companies in India – Driving Business Transformation.pdf
Odoo POS Development Services by CandidRoot Solutions
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Operating system designcfffgfgggggggvggggggggg
history of c programming in notes for students .pptx
System and Network Administration Chapter 2
How Creative Agencies Leverage Project Management Software.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Nekopoi APK 2025 free lastest update
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Wondershare Filmora 15 Crack With Activation Key [2025
PTS Company Brochure 2025 (1).pdf.......
System and Network Administraation Chapter 3

Python と Docker で mypy Playground を開発した話