Docker is a platform for building apps based on containers — small and lightweight execution environments that make shared use of the operating system kernel but otherwise run in isolation from one another.
Do you use Docker in your projects?
Docker is a platform for building apps based on containers — small and lightweight execution environments that make shared use of the operating system kernel but otherwise run in isolation from one another.
Do you use Docker in your projects?
For further actions, you may consider blocking this person and/or reporting abuse
Arif Hossain -
Kumar Deshmukh -
mpoiiii -
João Vitor -
Top comments (45)
I absolutely have to use Docker, when there are build dependencies, like platform specific installs, and Makefiles. Like Golang sometimes, and native postgresql extensions.
I wonder if I can use Docker to run non-web GUI apps. I want to avoid VirtualBox.
Of course, I realize that VSCode can be dockerized, but I haven't tried it.
You can easily do this on Linux by mounting the x11 socket. For other platforms it isn't so simple.
Please elaborate / suggest an article...
Like Xorg on different ports?
You can use the same Xorg instance:
I am on GNOME40 on Xorg.
Maybe its related to me being on rootless docker? Might be that you need to create a user with the same uid as the host for your case.
x11docker in case turning on the socket is a little much for you which I wouldn't blame you for but Jonathan's solution is rather elegant
My first x11docker project. I cannot run with
library/debian
forx11docker/lxde
, though.Thanks, it works. Although I need to install x11docker for AUR, instead of classic installation.
This is very interesting, I've never try it myself 🙂.
Nope, luckily the hardware we use is sufficient to run everything we need, our projects simple enough to not need to be containerised.
Often people do use it when it's not needed - as far as I'm aware it wasn't designed to be used as a development environment.
100% great tool with perfect use cases, but often found people use it when just not needed. Can imagine many basic NextJS or WordPress being built using it xD
It makes sense to use even for a nextjs site because you can ensure everyone is running the same thing locally. If you work on a team with people using different platforms virtualization is a good option and compose is easier to get up and running with than vagrant.
Your make my point exactly there by following dogma without first assessing the real situation.
Why does it matter that everybody is running the same thing locally? Who cares if somebody is on windows, somebody is on linux?
If the code committed to version control is accurate and the machines can run the code, then there's no issues and there's no need for over-engineering with virtualisation.
As per my original message, it's not "needed" unless you have complexities in your project which means your host machine cannot run it adequately.
It matters because some people will run into problems that others aren't. It solves a very real problem that I've encountered far too many times in my career.
What you're suggesting that due to incompatibilities between your team that you decided to use it to solve that issue.
That's my point - You used it to solve a specific issue on your team.
That is NOT justification for using it for everything "just because" - as most of the time there won't be a need, for example I've been developing a mixture of LAMP/JAM projects for around 20 years - never "needed" it - Yes there's times we could have used it. But never "needed" it.
This is the important information, the difference between "needing it" and "using it".
My experience with this is very different from yours. Lets just leave it as that.
Actually it totally has been targeting dev environments and honestly can't imagine doing reliable dev without it.
I am often switching between varsions of my development environments (nowadays php 7.2, 7.4 and 8 and also projects on various node environments). A local setup that allows clean switching between them and any number of mixes of extensions and so on? Feels a bit beyond insane.
I think it depends how robust your computer configuration is, e.g. on macOS the amount of effort setting up multiple docker environments for each configuration of PHP when you can effectively just do..
brew link php@7.4 or brew link php@8
Easily swap, same with Node, can swap the above commands for node.
It's great docker has solved this problem for you, many ways to solve the problem. For us typing a single command every so often is much less overhead than virtualisation for development.
Yeah, but there are 2 issues with this:
On a centrally managed docker file there is only one concern: building libraries for a given Linux architecture and that's it. Which is usually easy since it is the first supported on every update for php extensions and easiest to find docs for when needing to build it (I would list the horror of trying to build imagick 6 with heif support on Mac to the list - not the easiest thing on Linux either, but still easier)
Any of these operations may require specific system level dependencies (mainly kernel headers and other build deps) which isn't always possible if you do want to have a stable local system.
With Docker, I don't care, I can brew upgrade anything while in my project Dockerfile I can manually build stuff that may depend on curl 5.
I agree with what you're saying, BUT. I had originally said:
Everything you're describing are tools/websites with very specific needs - It's not often somebody needs to upload a heif images - This is my exact point :) Most websites don't need anything fancy and work fine - so Docker is too much, but IF you have a specific non-standard requirement, then this is where these tools become useful.
Funnily enough we picked up a PHP 5.6 project the other week using an ancient ruby, gulp and compass configuration - I laughed to myself thinking this was a good candidate for a containerised project :) But I proved my own point, A complex problem needs a more complex solution! Whereas everything else works fine!
Yes, in my opinion it is really basic tool in a development. Someone who doesn't use docker probably doesn't have much experience. Do you image this hell when you work with several apps on different stack and you would have to install locally all dependencies?
Nowadays I work almost exclusively with one stack, and so I'm not using Docker anymore (I used it before), as there is no real need for me to do so :-) ... but, Docker is a great piece of technology!
When I install a program not written by myself and not in the default APT repository, I'll try to install it inside Docker, to reduce the chance it messes up my servers.
I'm adding Dockerfile to some of my own programs too, so that I don't need to explain how to install dependencies.
I agree that it is not always necessary to use docker in simple projects. I have seen that many find it difficult because they lack knowledge of Linux and the technology in question (eg GO, Node, PHP, Python, etc.)
In my company we use it because we have projects in PHP and GO that use different versions each. In production we use it with docker compose to avoid dealing with different versions of databases.
I cant force myself to migrate from vagrant to docker. Docker really fills over-engineered and unnecessary complicated to use. I really need to find some good graphical program to manage all those docker machines just to avoid writing all those switches in terminal :P
Portainer is a web GUI for controlling Docker.
lowendspirit.com/portainer-a-docke...
(I never used it)
Portainer is recommended. Easy to install, easy to work with for beginners and seems full featured.
Hell yes.
I want my local environment as close to identical to my prod environment as possible. I want no surprises with cop-outs like "Well it works on my machine?" or "Did you get the new .env file?"
The only thing I know that does this effectively is Docker.
Looks like on this thread people have other examples of tools that do a great job of this too, I have some additional reading up to do. Also anyone with resources to said alternatives please share ☺️
Ditching Docker for podman and buildah has been a really nice experience. Having had issues with resource usage with Docker for a larger project in the past the change was noticeable. I'm a frontend dev, and using containers for things makes a lot of sense. I'm still trying to figure out k8s stuff, but have been able to create some small-footprint container images with the Universal Base Image, and host them on OpenShift. I really want to set up a more streamlined workflow using Che, but that has been slow for me to really wrap my brain around.
Been about 4 years since I've used Docker in 100% of my projects, both in dev as well as production and 6 years since I got in touch with containers.
Coincidentally about the same time span as I've been into Go.
Yes and I wonder why some people hesitate so much to use it. It makes life a lot easier and it's not hard to learn. I know only basic things and I'm still able to do pretty much everything I need (and for everything else documentation and SO can help).