Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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!

    Docker Client for Buildmaster

    Scheduled Pinned Locked Moved Support
    6 Posts 2 Posters 16 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      rpangrazio_2287
      last edited by

      So I am sure this is pretty easy, but I am new to Proget, Buildmaster and Otter. I have a Proget/Buildmaster server setup by using the official docker images. I am trying to build a docker container that the source is hosted in a AzureDev Ops Git repo. My Buildmaster server will clone the repo fine. When it tries to build it says

      Using LocalAgent agent on localhost
      A Docker client was not detected on this server.
      

      Here is my build script

      # Get Source
      # Fetch code changes from your source control system in order to build and run tests against them.
      {
          Git::Checkout-Code();
      }
      
      # Compile Project
      # Run a familiar build tool such as MSBuild, Maven, make, etc., pull packages & libraries, lint your code, and/or set version numbers.
      {
          Docker::Build-Image();
      }
      
      # Run Tests
      # Execute unit tests, static analysis tools, or capture reports.
      {
      }
      
      # Capture Artifact
      # Create a build artifact from the build output once all tests pass.
      {
          Docker::Tag
          (
              NewTag: latest
          );
      }
      
      

      How do I set up the docker client in the server? Pointing me to the right spot in the documentation would be appreciated, because I can't seem to find where it is.

      1 Reply Last reply Reply Quote 0
      • R Offline
        rpangrazio_2287
        last edited by

        So I fixed it by building a docker image based on the inedo image. Here is my docker file. So far seems to be working well. I then mount a docker socket into the container and then I can set the config variable to the docker executable, /usr/bin/docker.

        FROM debian:bookworm AS build
        
        
        RUN apt-get update
        RUN apt-get install -y ca-certificates curl
        RUN install -m 0755 -d /etc/apt/keyrings
        RUN curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
        RUN chmod a+r /etc/apt/keyrings/docker.asc
        
        # Add the repository to Apt sources:
        RUN echo \
         "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
          $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
          tee /etc/apt/sources.list.d/docker.list > /dev/null
        RUN apt-get update && mkdir /pkgs && apt-get install -y -d -o=dir::cache=/pkgs docker-ce-cli
        
        FROM proget.inedo.com/productimages/inedo/buildmaster:24
        
        COPY --from=build /pkgs/* /tmp
        RUN dpkg -i /tmp/*.deb
        
        atrippA 1 Reply Last reply Reply Quote 0
        • atrippA Offline
          atripp inedo-engineer @rpangrazio_2287
          last edited by

          Hi @rpangrazio_2287 ,

          Thanks for sharing that solution; the general approach we arrived at was setting up an SSL Agent to connect to the BuildMaster's Docker host (Installing & Integrating with Docker Engine).

          The approach you took is interesting; are you essentially installing Docker within the container? I assume that uses the Docker engine of the host, not like "docker in docker"?

          Thanks,
          Alana

          1 Reply Last reply Reply Quote 0
          • R Offline
            rpangrazio_2287
            last edited by

            It just installs the command line client, but yeah I am currently using the hosts docker server. I am investing other more secure options. I’ve seen docked in docker setups and may go that route and setup a build worker.

            atrippA 1 Reply Last reply Reply Quote 0
            • atrippA Offline
              atripp inedo-engineer @rpangrazio_2287
              last edited by

              Thanks for clarifying that @rpangrazio_2287 , we'll explore that route as well.

              We opted against DinD because of resource management (build servers can be rather resource-intensive) and general instability (not everything seems to work the same).

              FYI - in case you haven't seen it already, BuildMaster does support Image-based Services (Containerized Builds)

              Cheers,
              Alana

              1 Reply Last reply Reply Quote 0
              • R Offline
                rpangrazio_2287
                last edited by

                I am also against DinD because the way I saw it done involved installing a specialized runtime and I'm not particularly crazy about doing that. I'd like to find a more portable way of doing it.

                I admit I am new to Proget/BuildMaster/Otter and really like it so far. So I am sure that I will engineer some solutions that are, to be frank, Rube Goldburg-esque.

                1 Reply Last reply Reply Quote 1

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post
                Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation