25 points · by dprophecyguy · 9y ago · 46 comments
In general, I see a lot of people learning and using BuzzWord solutions for problems that they don't have.
In most cases, you'll have some problem and look for a solution to it. If your problem is spending a lot of time messing around with dependencies and deployments and "but it works on my machine" type issues, then Docker may well be the solution.
If you learn a solution and then see what problems it can solve (Hey, everyone is talking about Docker. Let me learn it too), you'll end up frustrated and confused.
Of course, it's a balance -- often you can learn about problems that you didn't even know you had by learning about new technology. But so far I see more people erring towards "Let's fix these problems I don't have" than "I'll just keep doing things this slow old way because I don't want to keep up with tech movements"
Quite honestly to most lazy developers the idea of repeatable and turn-key environments is anathema to them. "It's time consuming". "It's boring." "It's Somebody Else's Job." It is now my number one way to determine actual seniority and skill level in a developer during interviews.
Docker is not the panacea, but it's a game changer for many people as it lowers the barrier to entry for these things. We should embrace containers for what they are -- a very useful tool.
> We should embrace containers for what they are
Um.. relatively unrelated to the problem you described?
Containers are about isolating one or more processes, memory, network, disk etc from the rest of the host system. This can be used to achieve security benefits, and/or to resolve dependency differences.
The problem of repeatable dev environments is solved almost always by a single concept: script it, either using shell scripts, or a configuration tool like Chef, Puppet, etc.
In Vagrant, this means one or more provisioning scripts executed in the guest environment (usually a VM, might be LXC or Docker). In Packer, this peans one or more provisioning scripts executed in the guest environment (usually a VM, might be LXC or Docker). In Docker, surprise fucking surprise, it's a script executed in the guest environment.
THIS more than anything is the biggest issue I have when dealing with clients.
"Hey we need your expertise, this is our problem and we want to use <Docker/Kubernetes/AWS/MongoDB/<$NAME YOU COOL KID FLAVOUR OF THE MONTH>".
Thankfully, most people will listen to reason when you point out how $X won't actually solve their problem but $Y (which they've likely never heard of or dismissed because it's not being hyped by VC funded startups trying to defend their own poor choices) could.
Should you learn this - it depends. If you plan on building microservices whose devops you'll need to manage, docker is highly recommended. You can get away not learning kubernetes by relying on AWS ECS equivalents, and that's probably what you should do as a beginner wanting to deploy.
If your app architecture is event-driven, and can be rest based AWS lambda is a great option where you don't have to learn either. Beware of costs if invoking in the millions, but if your service ever scales to that, you've probably already found a lucrative opportunity that can afford experienced help
The former (or containers in general) is an excellent way to build repeatable and re-usable environments for development, then your test and CI environment(s), and then finally production, as you -- in a greenfield project, for instance -- crystallise your requirements as you go from the trappings of a blank project to a final one.
To say that either tool is aimed at microservices only is very misleading.
I will also take some exception to the notion that using Lambda with event sourcing means you don't have to learn how Lambda or, indeed, event sourcing works (pros and cons).
OP, your main goal is to ask yourself:
a) Can these two tools make my life easier (Docker? Definitely. K8s? Maybe.)
b) Do they improve the quality of the work I do so my client/boss is happy?Docker orchestrate can further improve your development situation, in which you can use it to define and test out multiple virtual servers on your laptop, such as the database, the file server and the web server.
Docker will also layer and cache each command greatly speeding up the "build&test" cycle of writing and running Docker containers. With Vagrant you're re-running everything every time.
Furthermore, you can actually use Docker with Vagrant also nowadays.
If you want to use Docker, you're then automatically using a hypervisor anyway.
> With Vagrant you're re-running everything every time.
Are you talking about the time to provision a non-created environment?
On a clean install, sure, that might take a while if your base-box doesn't have the dependencies you require - but most developers wouldn't often need to re-build their Vagrant environment for a project from scratch (i.e. vagrant destroy is not likely to be a common task). And that whole situation is moot if you use or build a more appropriate base box.
Want to try something in Postgres 9.4, you can do it with just one command, want Rabbit MQ with web stomp enabled, get it with just one command.
Setting up Environments with Docker is ridiculously easy, Docker files are pretty intuitive and easy to understand.
You don't need to learn how to build containers. Just the basics of how docker works.
- reverse proxy (traefik) - 2 web apps - jenkins - postgres - riemann - thumbor (thumbnailing service)
:)
https://training.docker.com/introduction-to-docker
If you are into Node, I'd also get up to speed with Serverless Deployments and Lambda Functions. Buzzwords, yes. But also modern, powerful and game changing. And most importantly, you won't have to worry about any devops internals ;)
1) how to write dockerfiles [1]
2) docker build, tagging, and push
3) docker run and docker exec
4) docker-compose
anything beyond that is probably not worth it unless you're also responsible for your infrastructure.
[1] https://docs.docker.com/engine/userguide/eng-image/dockerfil...
I've been using it since 2014 and it's one of the best software related moves I've made.
I wouldn't say I'm a super fan boy of anything, and I typically only use tools when they make my life way better. Docker is one of those tools because it helps me set up development environments for the web applications I develop, as well as help me move those apps to production seamlessly.
I'm a freelance dev so I have a lot of projects on my machine, and it's amazing to be able to spin up and shut down each app in seconds and also hand everything over to a client and have them run 1 command to get everything up and running regardless of whether they are running Mac, Windows or Linux.
When it comes to production, it's as simple as installing Docker and then running a few commands to have everything up and running with total confidence that it works. That's what Docker can give you in the end with not too much effort.
The reason it's a lot better than a VM is how fast and efficient it is. There's no massive disk space overhead and containers start in milliseconds, not minutes. Honestly it's not even comparable to a VM. There's just too many wins that make it an entirely different beast.
If you don't want to put in the 50 or 100+ hour grind of learning it on your own, I've assembled a 5 hour premium video course that will teach you how to dockerize your own web apps. You'll walk away fully able to use Docker in the real world. There are node examples too. This course is everything I've learned in the last 3 years of using Docker and is filled with best practices from real world usage and feedback from hundreds of people.
You can find that course at https://diveintodocker.com/.
If you have any questions let me know. I'd be glad to help. I'm also a Docker Captain (Docker reached out to me to become a trusted content provider) so I'm not just pitching you on buying something (if I didn't fully believe in Docker I wouldn't be spending my time personally using it).
I also have plenty of free Docker related material on my blog[0] and Youtube[1]. The first hour of my premium course is available on Youtube, no strings attached.
[0]: https://nickjanetakis.com/blog/tag/docker
[1]: https://www.youtube.com/watch?v=XeSD17YRijk&list=PL-v3vdeWVE...