A
A
Alexey Anisimov2017-09-21 16:56:58
symfony
Alexey Anisimov, 2017-09-21 16:56:58

How to properly set write permissions in Vagrant and Docker?

Good afternoon.
I'm running vagrant on Mac OSX, it contains docker and there is already a project on symfony.
How to set write permissions correctly?
I execute Vargant
up
Vagrant ssh
Cd /var/www/symfony
docker-compose exec php php app/console cache:clear
Gives a cache write permission error
Tried setting 777 in mac osx Tried setting 777
in ubuntu on vargant
Tried setting docker and nothing
I'm using nfs

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Anisimov, 2017-11-10
@AnisimovAM

The problem was with the APFS file system on Mac OSX High Sierra.
Solution:
1. Create a separate partition on the SSD in Mac OS Extended (Journaled) format
2. There are no problems with permissions :)

O
Oleg Bukatchuk, 2017-09-30
@olegbukatchuk

Greetings.
1. NFS is not quite the right way when using Vagrant.
2. It is best to use the machine.vm.synced_folder directive . For example, here is a working config for Vagrant.
ps

nodes = {
  "hostname_your_virtual_machine" => "192.168.10.10"
}

Vagrant.configure("2") do |config|
  config.vm.box = "debian/stretch64"
  config.vm.box_url = "debian/stretch64"
  nodes.each do |name, ip|
    config.vm.define name do |machine|
      machine.vm.synced_folder "/Users/user/mount_folder_name", "/var/www/symfony"
      machine.vm.hostname = "%s" % name
      machine.vm.network :private_network, ip: ip
      machine.vm.provider "virtualbox" do |v|
        v.customize ["modifyvm", :id, "--memory", 2048]
        v.customize ["modifyvm", :id, "--cpus", 2]
      end
    end
  end
end

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question