Which command can be used to add multiple insecure registries for Docker?

Prepare for the Docker Certified Associate test with our comprehensive quizzes that include key questions and detailed explanations. Ace your certification!

The command that allows you to add multiple insecure registries for Docker is through adding registries to the /etc/docker/daemon.json configuration file. This method involves modifying the Docker daemon's JSON configuration to specify the list of insecure registries that Docker should recognize when pulling images.

When utilizing the /etc/docker/daemon.json file, you can directly edit it to include an array of insecure registry URLs. This approach is advantageous because it enables you to persistently configure the Docker daemon settings across system reboots and updates, ensuring that the specified insecure registries are always available.

For example, an entry in the daemon.json file might look like this:


{

"insecure-registries": ["repo1", "repo2"]

}

After making changes to the configuration file, you need to restart the Docker service for the changes to take effect. This method is considered the standard practice for configuring additional registries in Docker.

The other choices involve methods that do not achieve the desired effect of permanently setting multiple insecure registries:

  • Running docker daemon --insecure-registries=repo1,repo2 would start the Docker daemon with a command-line option, but it does not provide a persistent solution since this option wouldn't
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy