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

Mais conteúdo relacionado

Mais procurados

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
 

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

Semelhante a 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)
 

Semelhante a 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
 

Mais 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悠滋 山本
 

Mais 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
 

Último

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 

Último (20)

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 

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!