how can I login to docker hub via Vagrant docker provisioner

I’ve read this documentation

I have a question what is the correct way to login via vagrant to docker hub?

  • sonatype nexus docker volume error
  • How to connect to containers on docker Overlay network from an external machine
  • Not able to Build any Dockerfile
  • Docker - how can I copy a file from an image to a host?
  • How can I create and use a variable inside docker?
  • Connect to WordPress Docker Container
  • config.vm.provision "docker" do |d|
      d.login <- doesn't exist
      d.username <- doesn't exist

    so, I think I need help.
    Does anybody know how should I do that?


  • installing ldap extension Docker
  • Possible to write a text file (or some other file) in a docker container but access it when container has stopped?
  • How to make docker-compose load the context from GIT to a specific directory?
  • Creating/Running a docker container from within a c# program (under mono)
  • systemtap:while resolving probe point: identifier 'process' at source: probe process().function no match
  • Kafka setup with docker using kafka-rb for clients
  • 3 Solutions collect form web for “how can I login to docker hub via Vagrant docker provisioner”

    I could not find a way using the Vagrant docs so did the following:

    Vagrant.configure(2) do |config| = "hashicorp/precise64"
      #provision with docker
      config.vm.provision "docker"
      # login to docker
      config.vm.provision "shell", inline: "docker login -e -p mexican_wall -u donald_trump"
      # then run your docker config
      config.vm.provision "docker" do |d| "ubuntu"

    Are you using the proper vagrant version?


    Vagrant.configure("2") do |config|
      config.vm.provision "docker" do |d| = ""
        d.username = ""
        d.password = ""

    It looks like you want to use rather than login in this case. Not super familiar with Vagrant’s docker provisioner, but the four parameters provided for access to a repository are email, username, password, and auth_server.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.