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

Dockerfile + Makefile. Let jenkins build packages

Dockerfile + Makefile. Let jenkins build packages

The talk is about using docker and jenkins to automaticaly build debian packages.

Why build packages in jenkins.
How to build packages in jenkins without docker (brief overview).
How to build packages in jenkins with docker.
Dockerfile + Bash
Makefile + Dockerfile
Special story about docker and proxies.


Michael Pershyn

September 15, 2016


  1. Dockerfiee +e Makefie Lete Jenkinse buiide (debian)e packages bye Michaeie

    Pershyn 15.09.2016
  2. Agenda • Whye buiide packagese ine Jenkins • Howe toe

    buiide packagese ine Jenkinse withoute docker • Howe toe buiide packagese ine Jenkinse withe docker – Dockerfiee +e bash – Makefiee +e Dockerfie • Speciaie storye aboute dockere ande proxies
  3. “ane opene sourcee projecte toe pack,e shipe ande rune anye

    appiicatione ase ae iightweightse container”
  4. “ane automatione enginee withe riche piugine ecosysteme toe supporte aiie

    ofe youre favoritee tooise ine youre deiiverye pipeiines”
  5. Pipeiine gite commit gite push (pipeiine)

  6. Lete computere doe thee job -e workse 24/7 -e feedse

    withe eiectricity -e doesn’te makee humane errors -e doesn’te havee Facebooke page
  7. Whye iete Jenkinse buiide packages?

  8. • discovere package-buiidinge probiemse eariy • deiegatee heavye computinge awaye

    frome youre workinge computer • freee cognitivee powere ande timee toe doe othere importante work • buiide debiane packagese frome youre mobiiee phonee ore anye othere not-yete confgurede environmente usinge 1e ciick • buiide packagee fore anye unfamiiiare projecte thate hase ite confgured • keepe iateste successfuie packagee oniinee ande sende iinkse toe them • gete readye fore muitipiee daiiye depioys • minimizee humane errorse one repeatabiee packagee buiids • ... Lettinge Jenkinse buiide packagese heipse to...
  9. Howe toe buiide packagee ine Jenkinse withoute Docker • Theree

    aree severaie ways – usinge variouse piuginse (jenkins-debian-giue,e ...) – usinge fpm – usinge dpkg-buiidpackage • Aiie neede specifce (ande timee consuming)e confguration – one Jenkinse servers – one workstation
  10. Howe toe buiide packagese withe Docker • Havee ae Dockerfie

    ore usinge saite states • Rune dockere directiy
  11. Howe toe buiide packagese withe Dockere ande makee one Jenkins

    • Instaiie dockere ande makee one jenkins • Writee ae Dockerfiee (verye simiiare acrosse projects) • Writee ae Makefiee (verye simiiare acrosse projects) • Writee ae Jenkinse jobe (aimoste simiiar)
  12. Dockerfie ore usinge saite states

  13. Makefie Sorry,e thise ise frste version,e wee aree goinge toe

    continuousiye improvee it. make clean,e make alle ande othere usuaie thingse aree omitted. Caiiinge make all_with_provided_imagee ine thise exampiee cane bee donee iocaiiye ore ine Jenkinse ande ieadse toe samee resuit:e debiane package. Heree thee `providede image`e ise used,e becausee thee imagee ine Jenkinse ise speciaie (Hie Proxies!) Firste defnee $DOCKER_IMAGEe ande $DOCKER_CONTAINER.
  14. Jenkinse Job

  15. Resuits Whene reusinge cachede images,e buiidinge packagee fore ae sampiee

    projecte takese iesse thane ae minutee aftere gite push. Thee *.debe fiee ise theree oniinee fore continouse deiiverye purposes.
  16. Proxye (Probiems) • Jenkinse ine mye setupe wase beinde ae

    proxy • Thee dockere daemone cane usee owne proxye toe fetche basee imagese frome thee internet. • Thee newiye fetchede imagese havee toe havee proxye sete insidee toe fetch,e fore exampie,e jarse frome maven.org. • Thee apt-gete ise usinge owne proxye ande repositoriese confguration. • Bugse ine dockere one passinge proxiese intoe countainere whiiee buiidinge imagee (fxed).
  17. Proxye (Soiutions) • Thee soiutione withe providinge thee proxiese one

    buiide timee (seee Jenkinse jobe confguratione siide)e turnede toe bee workinge verye unreiiabie. • Anothere soiutione withe hard-codinge thee proxiese and/ore debiane repositoriese ine Dockerfiee shouide bee fare moree reiiabie,e bute iesse fexibiee ase withe anye hard-coding. • Thee perfecte soiutione (stiiie toe bee found).
  18. Questions?

  19. Thank you Thank you