SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
Introduction to Stack's Docker
Integration
Yuji Yamamoto (山本悠滋)
2016-09-17 Haskell Day 2016
Nice to meet you! (^-^)
Yuji Yamamoto (@igrep) age 27.
NO RELATION WITH Emacs plugin "igrep.el"!
Nice to meet you! (^-^)
Software Engineer at GMO CLICK Holdings, Inc.
Writing online trading market of GMO CLICK Securities, Inc. in Java.
Hobby Haskeller.
Using Haskell for 4 years.
Holding workshop of Haskell (almost) every month.
Nice to meet you! (^-^)
( ̄^ ̄) Professional Haskeller.
(;^ω^) Used to be. Just for a month
(;_;) Using Haskell was given up
Due to difficulty of teaching my colleagues...
Advertisement m(_ _)m 1
HaskellJP wiki:
http://wiki.haskell.jp “〆(゚_゚*)
Anyone can edit with a GitHub account!
The most helpful page: Haskellに関する日本語のリンク集
Haskell-related pages in Japanese
Recently all edits are only by me... (;_;)
Advertisement m(_ _)m 2
Published a blog post 「JavaでMonadをはじめからていねい
に」 “〆(゚_゚*)
Monad in Java from the beggining
( ̄^ ̄) Told the relation between
the do notation and the associative law most clearly!
I'm gonna talk about...
What is Stack's Docker integration
How it works
Tips on using it
Case study
(^w^) May help you to convince your boss to adapt Haskell!
I'm NOT gonna talk about...
Basic usage of Stack
Basic usage of Docker.
Programming language Haskell itself.
TL;DR
With Stack's Docker integration,
(^-^) You can always build production-ready application
as easily as you use stack command as usual.
Background
How does GHC make Haskell code run?
Emit native executables!
Usually single, self-contained!
Just put the executables to deploy!
Stack itself is actually single binary!
But...
You must build for your production server!
Linux!
Dependent system (C) libraries and their version.
... and so on!
Corss-compilation with GHC is hard...
With Stack's Docker integration,
Build directly for your production environment.
Just by stack build as usual.
Stack's Docker integration does:
Wrap docker command.
Make almost all operation of stack on the container.
Setup GHC.
Install dependencies.
Then build your app!
Run tests.
How to use
1. Append docker option to stack.yaml
docker:
enable: true
2. Run stack build/install/setup as usual.
How it works
※Changes by the configurations.
1. Create a temporary container just for executing stack's
subcommands.
2. Share the project directory and ~/.stack by mounting.
Where dependencies and build artifacts are saved.
3. stack command runs in the container.
4. Delete the temporary container
Build dependencies and artifacts are still persisted.
How it works (cont)
5. Now you can upload the executable to your production,
staging, or any target server!
☆ Tips on using Stack's Docker
integration ☆
ᕦ(ò_óˇ)ᕤ Build on your own Docker image
三┏( ^o^)┛ Go over the proxy!
(x_x) DON'T overwrite ENTRYPOINT!
ᕦ(ò_óˇ)ᕤ Build on your own
Docker image
Default: Stack's original image (based on Ubuntu)
How to use CentOS/Debian/Arch?
How to install C libraries or any other non-Haskell
dependencies?
ᕦ(ò_óˇ)ᕤ Build on your own
Docker image
Edit stack.yaml
docker:
repo: "centos:6"
ᕦ(ò_óˇ)ᕤ Build on your own
Docker image
Edit stack.yaml
docker:
repo: "https://your-docker-repo/image:latest"
ᕦ(ò_óˇ)ᕤ Build on your own
Docker image
Or...
docker:
image: "<some_image_id_or_tag>"
ᕦ(ò_óˇ)ᕤ Build on your own
Docker image
Requirement for Orignal Images:
GHC must be installable (or already installed):
libgmp
Tools to build C sources.
gcc, make etc.
ᕦ(ò_óˇ)ᕤ Build on your own
Docker image
Requirement for Orignal Images:
Or, install stack itself in the image in advance.
ᕦ(ò_óˇ)ᕤ Build on your own
Docker image
Specify stack-exe
docker:
stack-exe: image
三┏( ^o^)┛ Go over the proxy!
docker:
env:
http_proxy: http://proxy.example.com
三┏( ^o^)┛ Go over the proxy!
May also need build-time-arguments...
$ docker build --build-arg=http_proxy=...
(x_x) DON'T override ENTRYPOINT!
ENTRYPOINT your-cool-entrypoint-command
Stack uses ENTRYPOINT internally!
Case study
Tiny mock server to test with an external Web API.
Must run on the staging server.
CentOS 6
Case study
Never mind zlib/libgmp/etc's diff in version, installation path.
Production-ready executables are always built on my
development machine!
Just by the familliar stack build/exec/...
Then scp the executable to our server!
stack install
scp ~/.local/bin/executable server@example.com:/
Case study
Demo
igrep/stack-docker-sample
Case study
(o˘◡˘o) My impression
(*´∀`*)ノ Comfortable:
I did't have to install anything except the built app.
(´∪`*) The tiny application didn't need even CI!
All was done on my development machine.
(x_x;) Initial build takes a long time...
(;^ω^) Haskell was not good for tiny apps!
(^-^) The Good News
Available on Docker for Mac OS X, not only Linux!
(x_x;) The Bad News
boot2docker is NOT recommended.
VirtualBox's shared folder is too slow!
Unavailable on Docker for Windows...
See this issue
Current limitation
Use on Linux or Mac OS X!
(;^ω^) Sorry Windows users!
Use the other VMs to run Linux!
Conclusion
Stack's Docker integration enables:
To build production-ready executables
as easily as you use stack command as usual. (^-^)
Only with your machine and scp!
But Haskell is too slow to compile tiny apps... (゚◇゚;)
Especially compiling dependencies!

Contenu connexe

Tendances

2016 may-31 dockercon2016–cool-hackssubmission
2016 may-31 dockercon2016–cool-hackssubmission2016 may-31 dockercon2016–cool-hackssubmission
2016 may-31 dockercon2016–cool-hackssubmissionMichael Bright
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopleffen
 
Deploying to DigitalOcean With GitHub Actions
Deploying to DigitalOcean With GitHub ActionsDeploying to DigitalOcean With GitHub Actions
Deploying to DigitalOcean With GitHub ActionsDigitalOcean
 
How to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangHow to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangKohei Kimura
 
Messaging with the Docker
Messaging with the DockerMessaging with the Docker
Messaging with the DockerHenryk Konsek
 
Compiling To Web Assembly
Compiling To Web AssemblyCompiling To Web Assembly
Compiling To Web AssemblyIgalia
 
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...sangam biradar
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CIColCh
 
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...Voxxed Days Thessaloniki
 
Going All-In With Go For CLI Apps
Going All-In With Go For CLI AppsGoing All-In With Go For CLI Apps
Going All-In With Go For CLI AppsTom Elliott
 
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesComandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesJulio Pari
 
Android kotlin coroutines
Android kotlin coroutinesAndroid kotlin coroutines
Android kotlin coroutinesBipin Vayalu
 
Panther: test your Symfony apps with real web browsers
Panther: test your Symfony apps with real web browsersPanther: test your Symfony apps with real web browsers
Panther: test your Symfony apps with real web browsersLes-Tilleuls.coop
 
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !Florent BENOIT
 
Learn enough Docker to be dangerous
Learn enough Docker to be dangerousLearn enough Docker to be dangerous
Learn enough Docker to be dangerousDavid Tan
 
Setting Sail With Docker
Setting Sail With DockerSetting Sail With Docker
Setting Sail With DockerKatie Hempenius
 

Tendances (20)

2016 may-31 dockercon2016–cool-hackssubmission
2016 may-31 dockercon2016–cool-hackssubmission2016 may-31 dockercon2016–cool-hackssubmission
2016 may-31 dockercon2016–cool-hackssubmission
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Deploying to DigitalOcean With GitHub Actions
Deploying to DigitalOcean With GitHub ActionsDeploying to DigitalOcean With GitHub Actions
Deploying to DigitalOcean With GitHub Actions
 
Rails in docker
Rails in dockerRails in docker
Rails in docker
 
How to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with GolangHow to build and distribute CLI tool in 15 minutes with Golang
How to build and distribute CLI tool in 15 minutes with Golang
 
Messaging with the Docker
Messaging with the DockerMessaging with the Docker
Messaging with the Docker
 
Compiling To Web Assembly
Compiling To Web AssemblyCompiling To Web Assembly
Compiling To Web Assembly
 
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
Google ko: fast Kubernetes microservice development in Go - Sangam Biradar, E...
 
There is no snapshot
There is no snapshotThere is no snapshot
There is no snapshot
 
Using GitLab CI
Using GitLab CIUsing GitLab CI
Using GitLab CI
 
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
 
Going All-In With Go For CLI Apps
Going All-In With Go For CLI AppsGoing All-In With Go For CLI Apps
Going All-In With Go For CLI Apps
 
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en KubernetesComandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
Comandos - Evento - Virtual Lab Despliegue de aplicaciones en Kubernetes
 
Android kotlin coroutines
Android kotlin coroutinesAndroid kotlin coroutines
Android kotlin coroutines
 
Docker: from zero to nonzero
Docker: from zero to nonzeroDocker: from zero to nonzero
Docker: from zero to nonzero
 
Panther: test your Symfony apps with real web browsers
Panther: test your Symfony apps with real web browsersPanther: test your Symfony apps with real web browsers
Panther: test your Symfony apps with real web browsers
 
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
 
Learn enough Docker to be dangerous
Learn enough Docker to be dangerousLearn enough Docker to be dangerous
Learn enough Docker to be dangerous
 
Setting Sail With Docker
Setting Sail With DockerSetting Sail With Docker
Setting Sail With Docker
 
CI and CD
CI and CDCI and CD
CI and CD
 

Similaire à Introduction to stack's docker integration (1)

From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...Jérôme Petazzoni
 
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 -  Working with Wercker WorksheetsOracle Developers APAC Meetup #1 -  Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 - Working with Wercker WorksheetsDarrel Chia
 
Ship python apps with docker!
Ship python apps with docker!Ship python apps with docker!
Ship python apps with docker!Rasheed Waraich
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshareCavelle Benjamin
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and KamailioGiacomo Vacca
 
Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Will Hall
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleHenryk Konsek
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisRuslan Shevchenko
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoHannes Hapke
 
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Ryan Weaver
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsTobias Oetiker
 
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes][HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]Wong Hoi Sing Edison
 
Makefile for python projects
Makefile for python projectsMakefile for python projects
Makefile for python projectsMpho Mphego
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Asher Martin
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using SwiftDiego Freniche Brito
 
DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldSchalk Cronjé
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageAlessandro Cinelli (cirpo)
 

Similaire à Introduction to stack's docker integration (1) (20)

From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 -  Working with Wercker WorksheetsOracle Developers APAC Meetup #1 -  Working with Wercker Worksheets
Oracle Developers APAC Meetup #1 - Working with Wercker Worksheets
 
Ship python apps with docker!
Ship python apps with docker!Ship python apps with docker!
Ship python apps with docker!
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshare
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and Kamailio
 
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
 
Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whale
 
Why scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with thisWhy scala is not my ideal language and what I can do with this
Why scala is not my ideal language and what I can do with this
 
Docker 101
Docker 101 Docker 101
Docker 101
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
Finally, Professional Frontend Dev with ReactJS, WebPack & Symfony (Symfony C...
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes][HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
 
Makefile for python projects
Makefile for python projectsMakefile for python projects
Makefile for python projects
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
DocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM WorldDocuOps & Asciidoctor in a JVM World
DocuOps & Asciidoctor in a JVM World
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stage
 

Plus de 悠滋 山本

Haskell-jpらしさって︖ 「⽬的」と「活動」のすべてを解説︕ 【プログラミング⾔語コミュニティーとしての Haskell-jp】
Haskell-jpらしさって︖ 「⽬的」と「活動」のすべてを解説︕ 【プログラミング⾔語コミュニティーとしての Haskell-jp】Haskell-jpらしさって︖ 「⽬的」と「活動」のすべてを解説︕ 【プログラミング⾔語コミュニティーとしての Haskell-jp】
Haskell-jpらしさって︖ 「⽬的」と「活動」のすべてを解説︕ 【プログラミング⾔語コミュニティーとしての Haskell-jp】悠滋 山本
 
Whom to Recommend Elm to?
Whom to Recommend Elm to?Whom to Recommend Elm to?
Whom to Recommend Elm to?悠滋 山本
 
いつもどおりのテンションでしゃべるEightの怪談
いつもどおりのテンションでしゃべるEightの怪談いつもどおりのテンションでしゃべるEightの怪談
いつもどおりのテンションでしゃべるEightの怪談悠滋 山本
 
Predefを使ったsqlのトレース
Predefを使ったsqlのトレースPredefを使ったsqlのトレース
Predefを使ったsqlのトレース悠滋 山本
 
Monad as things to do
Monad as things to doMonad as things to do
Monad as things to do悠滋 山本
 
Monadなんてどうってことなかった話 - Monadなんてただの型クラス!
Monadなんてどうってことなかった話 - Monadなんてただの型クラス!Monadなんてどうってことなかった話 - Monadなんてただの型クラス!
Monadなんてどうってことなかった話 - Monadなんてただの型クラス!悠滋 山本
 
2014 05-11-関数型lt大会-「やらなければならないこと」としてのhaskellのmonad
2014 05-11-関数型lt大会-「やらなければならないこと」としてのhaskellのmonad2014 05-11-関数型lt大会-「やらなければならないこと」としてのhaskellのmonad
2014 05-11-関数型lt大会-「やらなければならないこと」としてのhaskellのmonad悠滋 山本
 

Plus de 悠滋 山本 (7)

Haskell-jpらしさって︖ 「⽬的」と「活動」のすべてを解説︕ 【プログラミング⾔語コミュニティーとしての Haskell-jp】
Haskell-jpらしさって︖ 「⽬的」と「活動」のすべてを解説︕ 【プログラミング⾔語コミュニティーとしての Haskell-jp】Haskell-jpらしさって︖ 「⽬的」と「活動」のすべてを解説︕ 【プログラミング⾔語コミュニティーとしての Haskell-jp】
Haskell-jpらしさって︖ 「⽬的」と「活動」のすべてを解説︕ 【プログラミング⾔語コミュニティーとしての Haskell-jp】
 
Whom to Recommend Elm to?
Whom to Recommend Elm to?Whom to Recommend Elm to?
Whom to Recommend Elm to?
 
いつもどおりのテンションでしゃべるEightの怪談
いつもどおりのテンションでしゃべるEightの怪談いつもどおりのテンションでしゃべるEightの怪談
いつもどおりのテンションでしゃべるEightの怪談
 
Predefを使ったsqlのトレース
Predefを使ったsqlのトレースPredefを使ったsqlのトレース
Predefを使ったsqlのトレース
 
Monad as things to do
Monad as things to doMonad as things to do
Monad as things to do
 
Monadなんてどうってことなかった話 - Monadなんてただの型クラス!
Monadなんてどうってことなかった話 - Monadなんてただの型クラス!Monadなんてどうってことなかった話 - Monadなんてただの型クラス!
Monadなんてどうってことなかった話 - Monadなんてただの型クラス!
 
2014 05-11-関数型lt大会-「やらなければならないこと」としてのhaskellのmonad
2014 05-11-関数型lt大会-「やらなければならないこと」としてのhaskellのmonad2014 05-11-関数型lt大会-「やらなければならないこと」としてのhaskellのmonad
2014 05-11-関数型lt大会-「やらなければならないこと」としてのhaskellのmonad
 

Dernier

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

Dernier (20)

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Introduction to stack's docker integration (1)

  • 1. Introduction to Stack's Docker Integration Yuji Yamamoto (山本悠滋) 2016-09-17 Haskell Day 2016
  • 2. Nice to meet you! (^-^) Yuji Yamamoto (@igrep) age 27. NO RELATION WITH Emacs plugin "igrep.el"!
  • 3. Nice to meet you! (^-^) Software Engineer at GMO CLICK Holdings, Inc. Writing online trading market of GMO CLICK Securities, Inc. in Java. Hobby Haskeller. Using Haskell for 4 years. Holding workshop of Haskell (almost) every month.
  • 4. Nice to meet you! (^-^) ( ̄^ ̄) Professional Haskeller. (;^ω^) Used to be. Just for a month (;_;) Using Haskell was given up Due to difficulty of teaching my colleagues...
  • 5. Advertisement m(_ _)m 1 HaskellJP wiki: http://wiki.haskell.jp “〆(゚_゚*) Anyone can edit with a GitHub account! The most helpful page: Haskellに関する日本語のリンク集 Haskell-related pages in Japanese Recently all edits are only by me... (;_;)
  • 6. Advertisement m(_ _)m 2 Published a blog post 「JavaでMonadをはじめからていねい に」 “〆(゚_゚*) Monad in Java from the beggining ( ̄^ ̄) Told the relation between the do notation and the associative law most clearly!
  • 7. I'm gonna talk about... What is Stack's Docker integration How it works Tips on using it Case study (^w^) May help you to convince your boss to adapt Haskell!
  • 8. I'm NOT gonna talk about... Basic usage of Stack Basic usage of Docker. Programming language Haskell itself.
  • 9. TL;DR With Stack's Docker integration, (^-^) You can always build production-ready application as easily as you use stack command as usual.
  • 10. Background How does GHC make Haskell code run? Emit native executables! Usually single, self-contained! Just put the executables to deploy! Stack itself is actually single binary!
  • 11. But... You must build for your production server! Linux! Dependent system (C) libraries and their version. ... and so on! Corss-compilation with GHC is hard...
  • 12. With Stack's Docker integration, Build directly for your production environment. Just by stack build as usual.
  • 13. Stack's Docker integration does: Wrap docker command. Make almost all operation of stack on the container. Setup GHC. Install dependencies. Then build your app! Run tests.
  • 14. How to use 1. Append docker option to stack.yaml docker: enable: true 2. Run stack build/install/setup as usual.
  • 15. How it works ※Changes by the configurations. 1. Create a temporary container just for executing stack's subcommands. 2. Share the project directory and ~/.stack by mounting. Where dependencies and build artifacts are saved. 3. stack command runs in the container. 4. Delete the temporary container Build dependencies and artifacts are still persisted.
  • 16. How it works (cont) 5. Now you can upload the executable to your production, staging, or any target server!
  • 17. ☆ Tips on using Stack's Docker integration ☆ ᕦ(ò_óˇ)ᕤ Build on your own Docker image 三┏( ^o^)┛ Go over the proxy! (x_x) DON'T overwrite ENTRYPOINT!
  • 18. ᕦ(ò_óˇ)ᕤ Build on your own Docker image Default: Stack's original image (based on Ubuntu) How to use CentOS/Debian/Arch? How to install C libraries or any other non-Haskell dependencies?
  • 19. ᕦ(ò_óˇ)ᕤ Build on your own Docker image Edit stack.yaml docker: repo: "centos:6"
  • 20. ᕦ(ò_óˇ)ᕤ Build on your own Docker image Edit stack.yaml docker: repo: "https://your-docker-repo/image:latest"
  • 21. ᕦ(ò_óˇ)ᕤ Build on your own Docker image Or... docker: image: "<some_image_id_or_tag>"
  • 22. ᕦ(ò_óˇ)ᕤ Build on your own Docker image Requirement for Orignal Images: GHC must be installable (or already installed): libgmp Tools to build C sources. gcc, make etc.
  • 23. ᕦ(ò_óˇ)ᕤ Build on your own Docker image Requirement for Orignal Images: Or, install stack itself in the image in advance.
  • 24. ᕦ(ò_óˇ)ᕤ Build on your own Docker image Specify stack-exe docker: stack-exe: image
  • 25. 三┏( ^o^)┛ Go over the proxy! docker: env: http_proxy: http://proxy.example.com
  • 26. 三┏( ^o^)┛ Go over the proxy! May also need build-time-arguments... $ docker build --build-arg=http_proxy=...
  • 27. (x_x) DON'T override ENTRYPOINT! ENTRYPOINT your-cool-entrypoint-command Stack uses ENTRYPOINT internally!
  • 28. Case study Tiny mock server to test with an external Web API. Must run on the staging server. CentOS 6
  • 29. Case study Never mind zlib/libgmp/etc's diff in version, installation path. Production-ready executables are always built on my development machine! Just by the familliar stack build/exec/... Then scp the executable to our server! stack install scp ~/.local/bin/executable server@example.com:/
  • 31. Case study (o˘◡˘o) My impression (*´∀`*)ノ Comfortable: I did't have to install anything except the built app. (´∪`*) The tiny application didn't need even CI! All was done on my development machine. (x_x;) Initial build takes a long time... (;^ω^) Haskell was not good for tiny apps!
  • 32. (^-^) The Good News Available on Docker for Mac OS X, not only Linux!
  • 33. (x_x;) The Bad News boot2docker is NOT recommended. VirtualBox's shared folder is too slow! Unavailable on Docker for Windows... See this issue
  • 34. Current limitation Use on Linux or Mac OS X! (;^ω^) Sorry Windows users! Use the other VMs to run Linux!
  • 35. Conclusion Stack's Docker integration enables: To build production-ready executables as easily as you use stack command as usual. (^-^) Only with your machine and scp! But Haskell is too slow to compile tiny apps... (゚◇゚;) Especially compiling dependencies!