4 ms·
> This might end up getting a lot of hate. Why should I care whether you choose to use Docker (or other piece of software)? If your use-case doesn't require i
by trey-jones 6y ago
> This might end up getting a lot of hate.
Why should I care whether you choose to use Docker (or other piece of software)?
If your use-case doesn't require it, then you probably shouldn't use it. I do take issue with your evidence however:
> Deploying the app is as easy as:
> scp app user@host:
> ssh user@host “nohup ./app”
Not if you're deploying to production it isn't, unless this is Hello World. I've conceived quite a few from-scratch deployments for Go applications. Yes, it's simple, but there are a lot of complicating factors in an application of any substantial complexity:
- ENV files
- credentials for deployment
- database migration
- supporting files (eg. web assets)
- something to actually make sure your application stays up (eg. systemd)
Those are the first things that come to mind, and overall it's probably a lot less complex deployment than stacks other than Go allow. Let me tell you why I do use Docker - for dev and deployment, but not production:
- Reproducible builds for all apps on the correct version of Golang
- No dependency issues among members of the dev team. Everything you need is in the docker images.
- Easy imitation of production stack (again, correct versions, etc)
Those are the main reasons. I think the most important part is to make sure everybody is building the same application. Here is an example:
Suppose my colleague is using Debian and installed Go with apt. He's stuck on 1.13, but I'm using Arch and got 1.15 as soon as it came out. Now our builds are different. This is why we use docker to run applications in dev, and build for production. Or suppose a colleague is using Windows or Mac to build. There are still differences! Using Docker means everyone is building in roughly the same environment.
I realize certainly that some organizations control more tightly what OS an employee is using for this sort of thing. Mine doesn't, and Docker helps to keep us all on the same page (the Linux page, of course).