1

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?

  • You also posted the same question on nomad forums and they gave you an answer. https://discuss.hashicorp.com/t/how-to-change-the-default-docker-registry-in-nomad/38022 Please answer yourself using information provided or delete your question – lifeisfoo Apr 11 '22 at 07:22

4 Answers4

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.

1

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"
  }
}
0

If you want to pull images from private repository, then you can follow official documentation: https://developer.hashicorp.com/nomad/docs/drivers/docker#authentication

Just configure your task as follows:

task "example" {
  driver = "docker"

  config {
    image = "secret/service"

    auth {
      username = "dockerhub_user"
      password = "dockerhub_password"
    }
  }
}
Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
-1
task "example" {
  driver = "docker"

  config {
    image = "secret/service"

    auth {
      username = "dockerhub_user"
      password = "dockerhub_password"
    }
  }
}
Vivek Raj
  • 353
  • 3
  • 3