Skip to content

wordpress:cli container is not able to manipulate files #279

@mvasin

Description

@mvasin

Here's the docker-compose.yml file I use to bootstrap WordPress:

version: "3"

services:
  wordpress:
    image: wordpress
    ports: ["80:80"]
    volumes: ["wp_test:/var/www/html"]
    environment:
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_PASSWORD: secret

  mysql:
    image: mysql
    environment:
      MYSQL_ROOT_PASSWORD: secret

  cli:
    image: wordpress:cli
    volumes: ["wp_test:/var/www/html"]
    command: sh -c "sleep 20 && wp core install --path=/var/www/html --url=localhost --title=test --admin_user=test --admin_password=test [email protected]"

volumes:
  wp_test:

I start it with docker-compose up and when wp-cli sets up the installation, there is a warning:

cli_1        | Warning: Unable to create directory wp-content/uploads/2018/02. Is its parent directory writable by the server?

So, WP-CLI in cli container is not able to manipulate files on the volume attached to the main wordpress container.

I'm running docker compose 1.18.0 and and docker engine 17.12.0-ce on a mac.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions