1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrantfile で provision に docker を設定すると Warning: Authentication failure. Retrying... になる

1
Posted at

やりたいこと

vagrantでdocker-composeの環境を導入する

※事前に下記のコマンドが必要です

vagrant plugin install vagrant-docker-compose

失敗状況の再現

Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-16.04"

  config.vm.provision "docker"
  config.vm.provision "docker_compose"

  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.synced_folder "data/", "/home/vagrant/", create: true
end

上記のVagrantfileでvagrant upをすると、

==> default: Running provisioner: docker...
    default: Installing Docker onto machine...
    default: Warning: Authentication failure. Retrying...
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.

となってしまい、docker-composeのインストールができなくなってしまいます。

解決策

Vagrantfile
# synced_folderにホームディレクトリを指定
config.vm.synced_folder "data/", "/home/vagrant/", create: true

上記のように、同期元のフォルダにホームディレクトリを指定していることが原因だとわかりました。

Vagrantfile
# synced_folderにホームディレクトリを指定
config.vm.synced_folder "data/", "/home/vagrant/shared/", create: true

これを回避するためにホームディレクトリ以外のフォルダを指定するとエラーは起きなくなり、docker-composeコマンドも無事にインストールされていることが確認できます。

原因不明!

今の所なにが原因で失敗してしまうのかがわかっていません。
もしわかる方がいらっしゃればコメントにてお願いします。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?