Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Running InedoAgent on a Docker image
-
Let me start out by saying that I understand that at first glance you'll question why this is something I'd want to do. My primary reason for wanting to do this is that I'm trying to sell my company on using BuildMaster and I think one thing that will help is showing I can run an agent on a docker file and preferably Linux so that not only will the build happen in Linux but I can also kick of the unit tests in Linux. I looked into the containerized builds and that would solve half my issue but not the other. I've done a lot of looking around, and I know that installing the InedoAgent on a standard Linux is something you can ask support about but I haven't seen anything about putting it on a docker image for either Linux or Windows.
-
This isn't really something that makes sense in the Docker paradigm. Keep in mind that a Docker container is essentially a wrapper for a single executable and is designed to be disposed after the command runs. That's how the Image-based services work as well.
If you want to get Linux builds working, I'd start with a Linux-based server (create a VM) and SSH into it. You later try out Image-based services as well, but that also requires a Linux-based host.
Thanks,
Steve
-
This post is deleted!
-
Hi @stevedennis,
As I mentioned in the original post I had already tried the image-based services although I did refer to it as containerized builds. That helps with the build part but not with the unit test part. Of course I can't get that to work at all. You actually responded to the post I have on that as well so you know I'm still working at that.Unfortunately VMs are not an option for me at the moment. I'm trying to do this all on my laptop and so far I've been quite successful. I understand, based on your comment, I might be doing something a bit odd (I even suggested that in my original post) but wasn't expecting your reason. I do find your reason intriguing though. This job (been here almost a year) is the first time I've used Docker. They are using Docker (via Kubernetes) here to spin up web servers for web apps and APIs. Not all our apps have been migrated to this yet but they are essentially moving towards deploying all of our web apps and APIs to docker images instead of VMs. Maybe this isn't the best example but is what gave me the idea to try this, especially since I have docker running locally. In fact, the other confusing thing about what you said is that I know Inedo supports running BuildMaster in a Docker image so why not just the agent?
For the record, I'm not new to BuildMaster. I've actually been using BuildMaster for about 12 years now. I know you would typically put agents on the various servers you want to do things on and so why have one just running an agent. This is just to create a server for building. A very similar approach to the image-based services, it would support more commands than that feature does.
Bottom line is that this is my only option at the moment for this demo to have that capability fully (running both the build and unit tests in Linux). The bright side is that if I can get my other post figured out I that will be a huge plus in this direction. If anyone has any other thoughts on this I'd appreciate but I certainly understand if it isn't really feasible.
Thank you,
Brandon
-
You can run Linux VMs on your laptop without an issue. They don't require much disk space or memory, and that's what WSL2 does behind the scenes.
Docker containers aren't designed as or intended to be "servers" per se; they are meant to just run a single program without worrying about any operating-system dependencies. You can technically SSH into them and run other programs, but that's really only done in specialized debugging scenarios.
In other words, you should not be "running commands" inside a Docker container, whether using SSH another means. Instead, you use the
docker runcommand, which will create a container from an image, execute a command, and then stop the container.As far as getting unit tests to work, that may require additional dependencies. I don't really know. But they way to test that is by running commands like this:
docker run --rm -v "$PWD:/src" -w /src mcr.microsoft.com/dotnet/sdk:10.0 dotnet testThat basically just spins up a container to run
dotnet test. That is what BuildMaster is doing behind the scenes.When you do
docker run proget.inedo.com/productimages/inedo/buildmaster:2026.0it's doing exactly the same thing, you just don't get to choose get to choose the command that runs when the container "spins up".Hope that helps
Thanks,
Steve
-
Hi @stevedennis,
In a way I get what you are saying but either it isn't clear what I'm asking for or there is something else I'm still missing. Inedo has a registered image you can use to run BuildMaster as a whole in Docker. I take it that somehow this is different than running just the InedoAgent which is why there isn't a docker for just the InedoAgent. However, running BuildMaster on Docker means you are indeed running an agent on docker as well, it just happens to be running as part of the buildmaster web app which makes it all the more confusing. Of course maybe the version of BuildMaster that is running on the Docker doesn't include the built in agent?The other part that doesn't make sense is you say you shouldn't be "running commands" but I'm not really wanting to do anything that different from your suggested solution which is image-based services. I realize that in my case the image would be running all the time instead of spinning it up for the one command. The primary reason I am going down this path at the moment is you don't support running the unit tests with the "image-based services". If you did, and I could get it to work (still haven't) then I likely wouldn't have a reason to go down this path.
Thank you,
Brandon
-
oh, and I will look up this docker run command. Unfortunately that doesn't allow me to use the built in test function in BuildMaster which could take away from part of my sales pitch. We'll see what I can do, and maybe you or someone else will think of something else.