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!

    Proget docker image should support docker secrets

    Scheduled Pinned Locked Moved Support
    6 Posts 3 Posters 25 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.
    • S Offline
      scroak_6473
      last edited by

      Hi Guys,

      Please could you allow your ProGet docker image to support secrets. Secrets are mounted as files from the docker host to the container. You should then allow a docker environment variable to specify a file path to the secret.

      This could be used in a docker stack file in the following way:

      version: '3.4'
      services:
        Server:
          image: proget.inedo.com/productimages/inedo/proget:5.3.7
          networks:
            - traefik-public
            - clair
          environment:
            SQL_CONNECTION_STRING_FILE: "/run/secrets/proget_connection_string"
            TZ: "America/Denver"
          secrets:
           - source: proget_connection_string
             target: /run/secrets/proget_connection_string    
         volumes:
            - "/mnt/docker/proget/packages:/var/proget/packages"
            - "/mnt/docker/proget/extensions:/var/proget/extensions"
          deploy:
            mode: replicated
            replicas: 1
            placement:
              constraints:
                - node.platform.os == linux
        secrets:
        proget_connection_string:
          external: true
          name: proget_connection_string
      

      You can find out more about docker secrets here:
      https://docs.docker.com/engine/swarm/secrets/

      Thanks
      Simon

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

        hi Simon, thanks for the suggestion!

        I'll be honest, I'm really not that familiar with Docker Swarm or Secrets, but I wonder, from the "code inside ProGet perspective", does this seem as simple as like,

        // fake code, just an example
        if (EnvironmentVariables["proget_connection_string"] != null)
           return EnvironmentVariables["proget_connection_string"];
        
        else if (EnvironmentVariables["proget_connection_string_file"])
           return File.ReadAllText(EnvironmentVariables["proget_connection_string_file"]);
        
        else 
          return ReadFromNormalConfigFile();
        
        S 1 Reply Last reply Reply Quote 0
        • S Offline
          scroak_6473 @atripp
          last edited by

          Yes @atripp that looks easy enough. Hope to see it in a future version.

          Thanks

          Simon

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

            @scroak_6473 thanks Simon!

            I added PG-1790 to our system; one blocker I have... how should we document this?

            We'd love to even give an example of more advanced configuration, like how you have, of the Docker Compose file. Here's the current docs we have.

            https://github.com/Inedo/inedo-docs/blob/master/ProGet/installation/installation-guide/linux-docker.md

            If you can docs suggest or do a Pull Request that would help us get this done ASAP :)

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              scroak_6473 @atripp
              last edited by

              Hi @atripp

              I've created a PR and added an expanded section on Environment variables.

              I would suggest creating a new page called running on Linux docker swarm and I can add some example stack files/notes to that page later.

              Thanks

              Simon

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

                Hi @scroak_6473,

                I created a branch and a blank page on GitHub for Docker Swarm. You should be able to add your notes and examples there. Please let me know if you have any issues!

                Thanks,
                Rich

                Products Engineer, Inedo

                1 Reply Last reply Reply Quote 0

                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