Part of running a "Modern Perl" system means being ably to quickly test against different versions of perl. Learn why Docker makes this easier for the modern perl developer, and how to get started.
6. Beyond the beginning
REPL is nifty, but…
I want a current perl
To run this code I have
And add my deps
7. First Note
You can build up an image and save your whole app
Docker run, Add your needs, run
Or have a common base that just mounts your application code
docker build / tag / push
Registry Server
8. Running our first code
Pick our image
Mount our code directory
Install deps
…
Profit
What is Modern Perl?
How can you get “more” modern?
a renaissance
frequency, but you need to update
Does not remove usefulness of any of these, in fact can make them even more useful
test your code against multiple version
but you have to compile and maintain each one
Carton get the modules you use - if it works in your toolchain
SCL - Redhat/centos RPM based custom environments
Why beyond “Hipster” reasons?
Not for full VM’s really, look at the upcoming vagrant talk for that
The next generation of architecture
Slice out just the parts you need from a VM
Less exposure
Less data to cart around
Basic containers with just the engine you want to try
Perl latest
specific perl versions, options (eg threading)
and yes, perl6
What comes in the image? NOTHING..
You need to start adding things
so you can DO things, who programs without CPAN?
grab the basic and play, start adding in modules you use
save out your state, to use for later
Have your script pull in what it needs
Better, set one up with *your* use case, and start from that point
Have the base commands in the image
See, it’s that easy….
Interactive terminal
Clean up our container after ourselves
Mount my project directory under /app
which image am I based off of
What command do I run?
could be dzil authordeps | cpanm, or carton run
Well, who wants to build up that command line every time?
Build your arguments, and extra features into a file
Startup your app, process, etc just by feeding your file into docker
Build an image with your common starting point, or your final product
Docker pages have plenty of info and examples about better practices, such as && and working with image layers
Default command (my REPL in this case) but overrides with command line usage
Standard “Perl” library was > 750mb!
— If I’m running a container that is *only* the things I *need* it shouldn’t have to be that large!
Current standard starts at 255 - 285 mb
Built one off of Alpine and it was 75mb
What if you wanted to describe multiple containers at once? Docker file for a system of containers
Get them to know how to interact with each other
All your docker command line arguments
Automate a “system”
Define private network space
Other tools
Define custom locations, registry servers
Pull
update
build
run
log
I can reference by name : so refer to “mongo” or “redis” box in their DSN
docker-compose
Local box
can push build elsewhere
or quickly use prebuilt images to replicate
including out to live
- please learn when this is right (eg not db)
What is Modern Perl?
How can you get “more” modern?