Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Conversation

@borekb
Copy link
Member

@borekb borekb commented Mar 10, 2019

Issue: #1389

The CLI image is based on Alpine where the www-data user is UID 82 while the main WordPress image is based on Debian where www-data stands for UID 33. This causes trouble as files to /var/www/html are attempted to being read and written by different UIDs, depending on whether it's the Apache web server or WP-CLI / our testing code.

PR #1388 fixed the user on the docker-compose.yml level but that caused this portion of Dockerfile to become invalid. This PR moves the solution to the Dockerfile level – it explicitly uses "33" instead of "www-data".

Some related resources:

(Work on this is part of #1389.)

Alpine's www-data is UID 82. To make the two images work together, e.g., writes to `/var/www/html` by both Apache and WP-CLI, this image is customized to use UID 33 explicitly (it's user 'xfs' on Alpine Linux).

As a result, it's no longer necessary to set the user in docker-compose YAML.
@borekb borekb added scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc. scope: tests Testing code. For infrastructure (CI, etc.), use "dev-infrastructure". labels Mar 10, 2019
@borekb borekb added this to the 4.0 milestone Mar 10, 2019
@borekb borekb self-assigned this Mar 10, 2019
@borekb
Copy link
Member Author

borekb commented Mar 10, 2019

I've ran npm run build-images and then npm run tests:full, it seems to work equally well as #1388 but also fixes the issues with writing to test-logs that I've encounter in #1396 (similar to #1379).

@candrews, could you please review this change?

@borekb
Copy link
Member Author

borekb commented Mar 10, 2019

It's working for me and it'll be useful to have this in master for other PRs around #1389 so I'm going to merge this without further verification. We can do a followup PR if needs be.

@candrews, I'd still be interested in your opinion on this.

@borekb borekb merged commit f1e08a7 into master Mar 10, 2019
@borekb borekb deleted the 1389-cli-image-as-uid-33 branch March 10, 2019 13:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

scope: dev-infrastructure Build scripts, IDE settings, CI, Docker dev stack, testing, tooling, etc. scope: tests Testing code. For infrastructure (CI, etc.), use "dev-infrastructure".

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants