Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Just Run It

Just Run It

Don't install. Just run ... docker run

We already know this for the local dev environment. We no longer install the database or middleware locally, we just run it as a container, as needed.

But do we build locally with a container?

This prez shows 3 examples of how to build apps with Docker containers.

Avatar for William Bartlett

William Bartlett

March 28, 2019

More Decks by William Bartlett

Other Decks in Technology

Transcript

  1. Just Run It William Bartlett  [email protected]  @bartlettstarman 

    punkstarman  punkstarman Treeptik 28th March 2019 William Bartlett (Treeptik) Just Run It 28th March 2019 1 / 22
  2. Just Run It Don’t install Just run docker run William

    Bartlett (Treeptik) Just Run It 28th March 2019 2 / 22
  3. Let’s meet William Bartlett, Treeptik Agile Coach, Dev Docker enthusiast

    Windows detractor “Use the right tool for the job” William Bartlett (Treeptik) Just Run It 28th March 2019 3 / 22
  4. So? Problem How do you work with varying tech stacks

    without going mad? Solution Use containers! William Bartlett (Treeptik) Just Run It 28th March 2019 5 / 22
  5. We know $ sudo apt install mysql $ docker run

    mysql $ docker-compose up -d Really? $ docker run ... maven William Bartlett (Treeptik) Just Run It 28th March 2019 7 / 22
  6. Outline Related Solutions Maven Wrapper Haskell Stack LaTeX Presentation William

    Bartlett (Treeptik) Just Run It 28th March 2019 8 / 22
  7. Source Code All source code at https://gitlab.com/namrats/just-run-it A link to

    the slides will be tweeted. William Bartlett (Treeptik) Just Run It 28th March 2019 9 / 22
  8. Related Solutions Related Solutions Workstation as Code w/Ansible Virtualization w/Vagrant

    Virtualenv/Pipenv for Python NPM for Node Cloud IDE w/Eclipse Che William Bartlett (Treeptik) Just Run It 28th March 2019 11 / 22
  9. Maven Wrapper Maven Wrapper Requirements Shell Docker UID=$(id -u) GID=$(id

    -g) MAVEN_VERSION="3.6.0-jdk-8-alpine" MAVEN_OPTS="-Duser.home=/var/maven" exec docker run -it --rm -u $UID:$GID \ -v $HOME/.m2:/var/maven/.m2 \ -v $PWD:/usr/src/$(basename $PWD) \ -w /usr/src/$(basename $PWD) \ -e HOME=/var/maven \ -e MAVEN_CONFIG=/var/maven/.m2 \ maven:$MAVEN_VERSION mvn $MAVEN_OPTS "$@" William Bartlett (Treeptik) Just Run It 28th March 2019 13 / 22
  10. Maven Wrapper Maven Wrapper Concerns Caching w/volume Difficulties IDE integration

    William Bartlett (Treeptik) Just Run It 28th March 2019 14 / 22
  11. Haskell Stack Haskell Stack Requirements Shell Docker Stack stack.yaml resolver:

    lts-13.14 docker: enable: true William Bartlett (Treeptik) Just Run It 28th March 2019 16 / 22
  12. Haskell Stack Haskell Stack Concerns IDE integration w/LSP Difficulties Image

    size William Bartlett (Treeptik) Just Run It 28th March 2019 17 / 22
  13. LaTeX Presentation LaTeX Presentation Requirements Shell Docker Make DOCKERFLAGS=-it --rm

    -u $(UID):$(GID) \ -v $(LUATEX_CACHE):$(LUATEX_CACHE) \ -v $(CURDIR)/fonts:/usr/local/share/fonts \ -v $(CURDIR):/data \ -w /data \ -e HOME=/tmp TEX_SCRIPT=for run in $$(seq 2) ; \ do $(TEX) $(TEXFLAGS) $< ; \ done $(PROJECT_NAME).pdf: main.tex *.tex $(LUATEX_CACHE) docker run $(DOCKERFLAGS) $(DOCKERIMAGE) \ sh -c '$(TEX_SCRIPT)' William Bartlett (Treeptik) Just Run It 28th March 2019 19 / 22
  14. LaTeX Presentation LaTeX Presentation Concerns Caching w/volume Difficulties IDE integration

    William Bartlett (Treeptik) Just Run It 28th March 2019 20 / 22
  15. Conclusion Conclusion Wrapper shell script Tool integration Makefile Future work

    More tool integration, please containerized desktop apps (IDE) William Bartlett (Treeptik) Just Run It 28th March 2019 22 / 22