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::Build-Image on Linux server

    Scheduled Pinned Locked Moved Support
    6 Posts 3 Posters 23 Views
    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.
    • P Offline
      PhilipWhite
      last edited by PhilipWhite

      Not sure what exactly is wrong here. I have a Dockerfile in the git repo under code/

      Here is my OtterScript

      Git::Checkout-Code();
      
      SHExec >>pwd;
      ls;>>;
      
      Docker::Build-Image
      (
          Repository: mydockerserver/foo,
          From: $WorkingDirectory/code
      );
      

      I get this error:

      Unhandled exception: System.ArgumentException: The specified DockerRepository resource ("mydockerserver/foo") was not found.

      at Inedo.Extensibility.SecureResources.SecureResource.Create(SecureResourceType type, String resourceName, IResourceResolutionContext context)

      at Inedo.Extensions.Docker.Operations.DockerOperation_ForTheNew.CreateRepository(ICredentialResolutionContext context, String repositoryResourceName, String repositoryNameOverride) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp_E374097\Src\Docker\InedoExtension\Operations\DockerOperation.cs:line 41

      at Inedo.Extensions.Docker.Operations.BuildImageOperation.ExecuteAsync(IOperationExecutionContext context) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp_E374097\Src\Docker\InedoExtension\Operations\BuildImageOperation.cs:line 91

      at Inedo.BuildMaster.Windows.ServiceApplication.Executions.PlanExecuter.OtterScriptExecuter.Inedo.ExecutionEngine.Executer.IExecutionHostEnvironment.ExecuteActionAsync(ActionStatement actionStatement, IExecuterContext context)

      I manually built the docker image and pushed it as mydockerserver/foo:latest ahead of time, to verify that all works.

      Suggestions?

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

        Hi @PhilipWhite

        The Docker:: operations are intended to work with a Docker Repository Connection that you've configured for the application.

        The Repository parameter refers to the name under Application > Settings > Connections, and the error message is saying you don't have a connection named mydockerserver/foo configured.

        When it comes to Docker, our general guidance is to use the namespace part of a repository name, so instead of proget.corp.local/myDockerFeed/corp/myapp you would juse use corp/myapp or myapp.

        Hope that helps,
        Alana

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          PhilipWhite @atripp
          last edited by

          Ok thanks, I'll be a little more diligent looking through the docs next time. Here, I think, is a real issue though, the docker connection doesn't seem to allow digits in the repository name, despite the message:
          58d5ea02-3402-49ab-9c4c-f5f11a06e640-image.png
          Our actual Docker registry, does in fact, start with 'c4i'.

          1 Reply Last reply Reply Quote 0
          • rhessingerR Offline
            rhessinger inedo-engineer
            last edited by

            Hi @PhilipWhite,

            The Repository Name field is actually the name of a Docker Repository Connection, not the Repository itself. To add a Docker Repository Connection:

            1. Navigate to your application -> Settings -> All Settings
            2. Click "add" to the right of the Connections heading
            3. Select Docker Repository
            4. Select the repository type and fill in the fields (note: if this is not a ProGet Docker Registry, use Generic Docker Repository and then your registry and name will go in the Repository Name field here)

            Then take that resource name and add use that in the "Repository name" field in the Docker::Buid-Image operation. Also if you only have one Docker Repository Connection, you can leave it blank and it will use the variable $DockerRepository by default, which is automatically set to your Docker Repository Connection.

            Hope this helps!

            Thanks,
            Rich

            Products Engineer, Inedo

            P 1 Reply Last reply Reply Quote 0
            • P Offline
              PhilipWhite @rhessinger
              last edited by

              Hi @rhessinger,
              I should have taken a larger screenshot to show the context. That error I mention in my reply is when creating the connection:
              60dd3878-405b-49d1-9cd0-a411d31a9d08-image.png

              I'm pretty sure there is a bug in validating the "Repository name" field and it is disallowing digits in the name even though they should be allowed.
              -Philip

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

                Hi @PhilipWhite ,

                You're correct, this is a regression in the validation code...

                if (!value.All(c => (char.IsLetterOrDigit(c) && char.IsLower(c)) || c == '.' || c == '_' || c == '-' || c == '/'))
                    return new ValidationResults(false, $"Docker Repository names may only contain lowercase letters, digits, periods, underscores, slashes, or dashes.");
                

                I guess we recently added char.IsLower because UpperCase characters caused all sorts of problems.... easy fix, and easy work around.

                1. Just enter blah in the Repository name field, Click Save
                2. Click "view all"
                3. Click on the Docker repository in that view, edit

                We'll get this fixed for teh next maintenance release via BM-3932

                Cheers,
                Alana

                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