Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mvasin opened this issue Feb 2, 2018 · 4 comments
Closed

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

mvasin opened this issue Feb 2, 2018 · 4 comments

Comments

@mvasin
Copy link

mvasin commented Feb 2, 2018

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 --admin_email=test@example.com"

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.

@jaswrks
Copy link

jaswrks commented Feb 6, 2018

👍 Having the same exact problem myself in the same environment.

@mvasin
Copy link
Author

mvasin commented Feb 6, 2018

Seems like UIDs (numbers that stand behind linux user names) are out of sync, more details here, here and here.

@jaswrks
Copy link

jaswrks commented Feb 6, 2018

I see! Thank you.

So this looks like the same issue reported in #256. I was able to work around this temporarily by running commands as the specific user ID 33, which is normally associated with www-data, but is actually xfs in the cli image.

docker-compose run -u 33 ...

@mvasin
Copy link
Author

mvasin commented Feb 6, 2018

So I'll close this as a duplicate, let's continue in #256.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants