3 ms·
> Running a program in a container is a lot like running it normally, but the user doesn’t need to jump through hoops to configure the system, build and install
by ogre_codes 6y ago
> Running a program in a container is a lot like running it normally, but the user doesn’t need to jump through hoops to configure the system, build and install.
Docker is itself a complex build tool which requires a bunch of install steps. If you are going to ship software to end users there is almost always a better way to bundle and ship than send someone a Docker container.
Docker is not a distribution tool, if you are expecting your end users to install Docker, you've already screwed up.
> Downloading a pre-compiled binary is almost like this, except with worse odds. Maybe there’s a build for your architecture. If it was statically linked, you’re golden. Otherwise, use ldd to reverse engineer the fact that you need to install libjpeg.
On Mac and Windows this is almost never an issue. Even on Linux, it's pretty straight forward to statically link your binary if you aren't sure about the environment it's going to be run on. Statically linked binaries are a bit bloated... but not as bloated as a damned Docker image which contains entire dependency trees.
In no case is "Making it into a Docker Image" a simpler/ better distribution mechanic.
- tedk-42 6y agoSorry but you're wrong. A vast majority of software ships after it has been built as a stand alone application as well as a Docker container so that it can be run in container environments. A lot of CI systems natively support Docker because of the variety of tools and images you have available to run you CI steps in. Docker is an excellent distribution tool because it only requires Docker. You can send someone some python code and ask them to run it, only to find they're missing a bunch of C libs required to build and run the code which is a pain to help them figure out how to solve. Docker solves many of these problems but has a drawback of being more 'bloated' than other distribution mechanisms. It doesn't make it a bad one though.
- ogre_codes 6y ago> You can send someone some python code and ask them to run it, only to find they're missing a bunch of C libs required to build and run the code which is a pain to help them figure out how to solve. You can send someone a Docker file only to figure out they've never heard of Docker. Let alone don't have it installed and aren't interested in setting up a container system to your 500 line Docker script. All you've done is move your problem upstream. Unless your consumer is a web developer, you are out of luck.
- tedk-42 6y agoThe learning curve for docker is minimal. As I mentioned before it's very useful in CI systems where you want to be building and testing your code in a clean environment that is reproducible across machines. Trying to debug when a core library or header dependency is missing to build your code requires far more skills and differ between operating systems and versions of operating systems. The problem isn't moved upstream, it's tackled in a very clever and well packaged manner.
- t-writescode 6y ago> In no case is "Making it into a Docker Image" a simpler/ better distribution mechanic. For my home server setup, I have docker containers for: * PiHole * NextCloud * Home Assistant If I had to install each of those manually, I probably wouldn't have installed them. This is especially true of NextCloud, which almost certainly would have required me to learn how to run nginx on my own, install php or whatever application it uses as the middleware, etc. Instead, I configured my DNS and ran a Docker command and was off to the races. Server-level Open Source Software's installation process is often so complicated and has so many dependencies if it's not something you can get from your repository's package manager, at least in my experience, that docker is almost always the easiest option. What beats a single command and maybe reading a config on what ports to forward or how to set up your config. And then you get a docker-compose if you want to be creative, yourself. Unless you're already very skilled at dev-ops, docker is easier.
- Nursie 6y agoOnly if you're already skilled at docker.
- donmcronald 6y ago> This is especially true of NextCloud I have a huge (personal) wiki page for installing and maintaining NextCloud from before they had a decent Docker image. Now I’m content to let it be a black box I don’t have to think about, so I run it in Docker. It saves a ton of time and hassle. Docker adds a lot of value when devs ignore the best practice advice of putting everything in a separate container. That’s just a package manager with extra steps IMO. It’s the mini distro style containers like GitLab’s that can save you a masssive amount of time.
- ogre_codes 6y agoIt's a fair point and a good example of why there are no absolutes, but hardly addresses the bigger point. If you have an app that formats JSON files, are you shipping it as a Docker container? Or a linter? How about a text editor? The number of applications where it makes sense to bundle them as VMs is quite small.
- Nursie 6y agoOn linux just use the system package tool to declare your dependencies. Yes, you may end up making a deb and an rpm but honestly, it's not an earth-shattering amount of work, lots of companies do it, and then the tool will tell the user "requires libjpeg".