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
NeedsSudoCheck docker detection not working with Docker Buildx #11848
Comments
Same problem here, using GitLab. |
It seem's plugins are not loaded, this seems related to this issue : #11839 Composer release 2.7.0 changelog stated this : If you see errors with missing commands (symfony-cmd: command not found) or other failures and
you are relying on plugins and running Composer as root (for example when you use AWS ElasticBeanstalk),
read https://github.com/composer/composer/issues/11839 Solution mentioned in the issue above is :
|
I think that using root when building in docker is a normal use case and composer must allow it |
@vtsykun and composer supports allowing it. That's what the environment variable is about. |
Seems the file
|
Seems the |
As long as You can still use the |
Yes, I see. Perhaps an alternative solution could be to check root user linux kernel capabilities |
I don't think we can do that. |
Yeah this is ultimately a docker build issue. If they don't provide us with a way to detect it we're left with random hacks which may or may not break. So please report it there, the more people complain the more likely they'll take this seriously. |
For github and gitlab actions more specifically we might be able to detect those as they have env vars like GITHUB_ACTIONS present but I'm not sure if the env is available within the containers. If someone can check that'd help. |
Hi, In GitLab, you have to declare a new CI/CD variable (e.g. called Then in your Dockerfile you should do something like this: FROM ...
ARG COMPOSER_ALLOW_SUPERUSER
ENV COMPOSER_ALLOW_SUPERUSER=$COMPOSER_ALLOW_SUPERUSER
RUN composer install This should work too: FROM ...
ARG COMPOSER_ALLOW_SUPERUSER
RUN COMPOSER_ALLOW_SUPERUSER=$COMPOSER_ALLOW_SUPERUSER composer install Even something like this works well to me: FROM ...
USER www-data
RUN composer install
USER root |
This error related with #11839 but now for Docker builds. As I see composer has docker detections to allow run plugins under root only if it running into docker
But after updating the composer the docker builds that were launched under GitHub Action began to fail. But local
docker build .
works fine.You may use this github action to reproduce bug.
The text was updated successfully, but these errors were encountered: