john
john

Reputation: 478

Change file group with docker-machine

I installed docker-machine on my Mac and when I install laravel on a container who runs Apache, I'm not able to change the groups on the files to put them on www-data.

When I try:

/bin/chown www-data:www-data -R /var/www/laravel/storage /var/www/laravel/bootstrap/cache

I have this error message:

chown: unknown user/group www-data:www-data

I try to add user to www-data group and restart docker-machine, but this does not work.

My setup is this: I have a virtualbox mapping with my Mac. The file /var/www is mapping for my /Document/site. I use the images on Docker Hub. The file image is mysql and is mapping with the port 3306 and I save my db to /var/lib/boot2docker/mysql. The second image is apache and I map the port 8888:80. My Dockerfile contains nothing, but my docker-compose.yml has:

web:
  image: eboraas/apache
  ports:
    - "8888:80"
  volumes:
    - /var/www/laravel-site:/var/www/html
  links:
    - db:db

db:
  image: mysql
    ports:
      - "3306:3306"
    volumes:
      - /var/lib/boot2docker/mysql:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root

I load laravel with compose to my Mac.

Upvotes: 0

Views: 552

Answers (1)

user9609399
user9609399

Reputation:

to do what you want to do you have to do a docker-dial and run your script locally

put this in your docker-composer

web:
  image: eboraas/apache
  ports:
    - "8888:80"
  volumes:
    - /var/www/laravel-site:/var/www/html
  links:
    - db:db

db:
  image: mysql
    ports:
      - "3306:3306"
    volumes:
      - /var/lib/boot2docker/mysql:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root

docker will create container for you in your local machine et after create a map with docker.sock

Upvotes: 1

Related Questions