Linux - ContainersThis forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I have some questions about the Docker configuration:
1- I want to start an Nginx container using Docker Compose, what is the problem with the following configuration?
"The powers that be" decided that a new thread was "a duplicate," but a few new questions were asked, so let's look at them here:
Quote:
1- In an internet article, a file called docker-compose.yaml was created to build the container. Can I create a YAML file for each container and use docker compose up -d to run it? If this is possible, how can I specify the input file?
2- I want to start a website that uses Nginx web server and PHP and JavaScript programming languages. Do I need a container for each (Nginx, PHP and JavaScript)?
[...]
4- I have created a container and now I want to make some changes in the YAML file and apply these new changes to the container. What should I do?
5- Is there a special folder for making containers? For example, the /var/www directory is for the web server.
The short-answer is: "there is no 'right' answer." But, a key idea of Docker is that you can "simply grab stuff 'off the shelf,' and not bother to read the ingredients label." For instance, there are many "canned" container definitions for – a MySQL server, an Nginix server, and a PHP server that is intended to be talked-to by Nginix. (Notice that there is not "all in one ..." Although of course there could be.) Usually, what you want to do is to "simply, string together" these "cans." And, there are plenty of existing websites and tutorials which will show you exactly how to do that. "Do what they did, and be happy."
Be mindful, as you are using "containers," that the container occupant does not "see" the host system. Instead, it sees the filesystem and the network that you specify. But, once again, there have now evolved "accepted standards" as to how you probably should set the host system up. Don't carve brand-new paths in a nearby field when there is a road nearby. "That's why you have decided to use Docker!"
Docker is not, per se, "an entirely-new 'container system.'" Even though, today, it is. (Originally, it used "lxc/lxd.") Basically, it consists of "convenient packaging." Tens of thousands of us(!) are basically out there doing the same thing. So, "somebody built a power-tool." Like Docker.
Because: "Actum Ne Agas: Do Not Do A Thing Already Done."
Last edited by sundialsvcs; 03-14-2024 at 09:15 AM.
there was life before containers. You do not need to use containers at all, but you may use them if you find them useful. As usual.
You need to learn how to do things, you need to understand how they work. What is the purpose of that yaml file, what contains a container and how can you build and update it. All these things are very well documented and I can only repeat those sites.
What's the point of all this if you don't understand anything out of it?
Here’s what I suggest: search for any one of the many dozens of tutorials which show you, step by step, how to “set up LAMP in Docker.” Follow their instructions explicitly. And, as you do so, carefully notice which Docker packages they selected – and why. Yes, there’s a bit of a learning curve for you to simply get past.
The entire idea behind “Docker” is to fully-automate, as much as possible, the steps that “we all have to do.” Of course it’s not the only way, but it’s convenient. I strongly encourage you then to “peek inside” each of the packages to see exactly what they did. “How was the trick done?”
Originally Posted by Jason.nix View Post
Hello,
Thanks, but I did not receive answers to my questions.
OK. Then try these two, before you do anything else. They are also how I learned. The next other best thing I can do for you, if you watch these and don't find any helpful answers, is show you my searches, which I will do here too, and then, if you still need help, upload my linux command file, of linux commands I know. It doesn't contain all docker knowlege I have, but I'd be surprised you didn't find what you were looking for, by the time I did all that, but first if you watch those videos.
I haven't built anything with docker yet (working on it), it's new to me too. I admit I haven't yet found a good use for docker-compose. However, I'm still pretty dangerous with docker. I know it took some time, but I will be able to build what I'm trying to build in a few months (save the Linux Active Directory Server - That's a bit much for me for now). I admit I will need some help here and there. HOWEVER, I CAN DO WHAT I'M TRYING TO DO, ableit a learning curve. If I can, others can too, if you're already at the level you show from trying to write the file. Just to be complete, I will try to find again and link a server building website I learned from ages ago! I'll have to do so in the next post, this is getting too long. But if they helped me, they should help you too, again, judging from the level you shown by trying the file. If you were at an earlier level, you probably couldn't put the file together. I also don't know where you stand with overall linux knowlege, but first of all, that's why I'm trying to give back, because it's a way to help, and I now know quite a bit. But I DID go to school pretty short ago too.
But basically, at my level, I can't give you the answer. But I can tell you where to look. I would give you them if I had them. And then, after I've done as much as I said, if I even need to complete those steps, there's nothing else I can do for you, so then I will go silent. But I do think that since you're still posting here, that I can do that much.
If someone knows where the other thread is, better link them together, unless you instruct me not to post, when they are posting so constantly. But to everyone, if I do this that I'm thinking, and it still doesn't help, there's nothing more I can do. Short of learning to give classes, but right now, I can't open the classes I give up to the public. I can't afford the costs to do that right now, and I'm not making any money at those classes. Here goes in the next post...
That's step #1. Try to use these first. If those don't answer all your questions, then please tell me, but make effort to use them first. Then, if it doesn't, I will upload my linux command file, if it lets me. If that doesn't work, then I'll be at the point of going silent probably.
Hopefully this helps though, though I can't give you the exact timeframe where they talk about docker compose.
This is also, one of my best and most helpful threads, I think, so if you found some help because of it, try to up my rep if you know how. I'm not sure I know how, but I would think it's done by clicking on the rep link. I haven't messed with that so far, but I'd like to start learning the rep, and get more rep, WHEN I'M HELPFUL.
"Docker" ≠ (!!) "Containers!" The two are not the same.
"Docker" is designed to create very-convenient packaging, within – shall I say, "on top of" – a "containerized" environment, for "the things that we most-commonly do." For example, "setting up a LAMP plus MySQL plus FastCGI server." Boom. Install a few packages and just sit back and watch it work.
"Extra-credit points" if you delve into the internal workings of any of them to see exactly how they work. (Old-schoolers like me might refer to this as "a MACRO facility," and they would also know why I used "all caps" or a particular typeface.) But, a helluva lot of people out there, now, don't have any need to do so, and that is precisely the point. "Good for them."
Docker, of course, turned out to be "a huge success" in a pragmatic commercial world which needs to "quickly and reliably" deploy identical copies of the same thing, without investing "human time" and exposing itself to "human error." (Sound familiar?) Download "a package" – or "build one" as the case may be – and, there you go. Can you describe your system's requirements in terms of "it needs [these] 'library Docker containers?'" "Good for you," especially when you shop for certain flavors of "cloud hosting" (which were built with this in mind ...).
Programmers worked very quickly to enable you to "reap Docker goodness," regardless (as much as possible ...) of your "host operating-system type." And they generally succeeded. "But, I digress."
But there are other ways to approach this (in Linux). For example, "lxc/lxd" provides something much closer to a "bare virtual machine." (And, in fact, "Docker" started out by using this as its foundation.)
As always, "the beauty of Linux is: choice." (And, yeah: "power tools.")
Last edited by sundialsvcs; 03-18-2024 at 08:19 PM.
"Docker" is designed to create very-convenient packaging, within – shall I say, "on top of" – a "containerized" environment, for "the things that we most-commonly do." For example, "setting up a LAMP plus MySQL plus FastCGI server." Boom. Install a few packages and just sit back and watch it work.
...And that's why I included a link to "The Perfect Server"...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.