skip to Main Content

I want to change the default docker registry configuration in nomad. I am setting up a nomad cluster in enterprise VM, which connects to frog artifcatory docker registry. Any docker hub images reference has to go through the internal artifactory registry.

But when I setup nomad and try to install waypoint inside nomad, it looks for busy box and waypoint server and runner images from docker hub.

How can I change the configuration for nomad to go via artifactory to reach docker hub?

3

Answers


  1. Chosen as BEST ANSWER

    I have asked the same question in nomad forums and got an answer for this. I am posting and adding link to the suggested answer here.

    https://discuss.hashicorp.com/t/nomad-network-bridge/37421/2

    You can configure Nomad to use an alternate image by configuring the infra_image under the Docker plugin options in Nomad’s agent configuration.
    
       
    
     plugin "docker" {
      config {
        infra_image: "<local mirror>/google_containers/pause-amd64:3.1"
      }
    }


  2. It’s not possible to set a "default" registry for the Nomad client’s Docker driver. The registry would need to be set in the "image" configuration of the Nomad jobspec’s "config" stanza. Within that config stanza, or on the Nomad client, you would need to provide an "auth" stanza as well so that Nomad can pull the image from your private registry.

    https://www.nomadproject.io/docs/drivers/docker

    Regarding Waypoint specifically, for your requirements, I’d recommend installing Waypoint not with the waypoint install command, because there isn’t an option to change the Docker repository from which the busy box image is used. Instead, I’d recommend creating a custom Nomad jobspec to deploy Waypoint, and if you intend to use busy box as part of that jobspec, then to specify your image repository in Artifactory that way.

    Login or Signup to reply.
  3. task "example" {
      driver = "docker"
    
      config {
        image = "secret/service"
    
        auth {
          username = "dockerhub_user"
          password = "dockerhub_password"
        }
      }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search