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

Fixes when building with buildkit #259

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Conversation

yosifkit
Copy link
Member

@yosifkit yosifkit commented Mar 12, 2024

Current images fail to build since buildkit doesn't have /.dockerenv during build; see composer source for its behavior change based in "being in a container".

Abbreviated failure log:

+ composer create-project --no-interaction drupal/recommended-project:10.1.8 ./
...
  - Installing composer/installers (v2.2.0): Extracting archive
The "composer/installers" plugin was not loaded as plugins are disabled.
  - Installing drupal/core-composer-scaffold (10.1.8): Extracting archive
The "drupal/core-composer-scaffold" plugin was not loaded as plugins are disabled.
  - Installing drupal/core-project-message (10.1.8): Extracting archive
The "drupal/core-project-message" plugin was not loaded as plugins are disabled.
...
No security vulnerability advisories found.
+ chown -R www-data:www-data web/sites web/modules web/themes
chown: web/sites: No such file or directory
chown: web/modules: No such file or directory
chown: web/themes: No such file or directory

(In fact, there is no web directory at all, see the composer issue below)

See also:


Setting the fix as an ENV so that anything FROM drupal:10.* can also benefit from it when building via buildkit.

@tianon
Copy link
Member

tianon commented Mar 12, 2024

Given that it worked fine with 2.7.1, I think composer/composer@c3efff9#diff-3614f0bf6a66fbe9056036cae6165d9eaa2097f5472e976b5f26e32322bedc2fR302 + composer/composer@c3efff9#diff-96b25cef37257db25ed95d466925aaf0feee2ba65b3a5cb22c07ad9bb36b60b7R224 might be the "smoking gun" -- the prior code for that create-project block was not disabling scripts, but the new block is.

@tianon
Copy link
Member

tianon commented Mar 12, 2024

JK those are mostly the same, I dunno why it's broken on 2.7.2 and only in BuildKit (clearly related to the /.dockerenv detection, as you've noted), but this change is correct either way 👍

@@ -93,6 +93,11 @@ COPY --from=composer:{{ .composer.version }} /usr/bin/composer /usr/local/bin/
ENV DRUPAL_VERSION {{ .version }}
{{ if has("composer") then ( -}}

# https://github.com/moby/buildkit/issues/4503
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have a docker-library/drupal number, we should maybe inject it too 👀

Suggested change
# https://github.com/moby/buildkit/issues/4503
# https://github.com/docker-library/drupal/pull/259
# https://github.com/moby/buildkit/issues/4503

@tianon tianon merged commit 5f1aafc into docker-library:master Mar 12, 2024
38 checks passed
@tianon tianon deleted the buildkit branch March 12, 2024 23:58
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Mar 13, 2024
Changes:

- docker-library/drupal@5f1aafc: Merge pull request docker-library/drupal#259 from infosiftr/buildkit
- docker-library/drupal@2c93dfe: Fixes when building with buildkit
- docker-library/drupal@d1c8fc7: Update GHA YAML with bashbrew example improvements (esp. concurrency:)
martin-g pushed a commit to martin-g/docker-official-images that referenced this pull request Apr 3, 2024
Changes:

- docker-library/drupal@5f1aafc: Merge pull request docker-library/drupal#259 from infosiftr/buildkit
- docker-library/drupal@2c93dfe: Fixes when building with buildkit
- docker-library/drupal@d1c8fc7: Update GHA YAML with bashbrew example improvements (esp. concurrency:)
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

Successfully merging this pull request may close these issues.

2 participants