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

Composer plugins have been disabled for safety in this non-interactive session when building Docker image #382

Open
khalyomede opened this issue May 20, 2023 · 1 comment

Comments

@khalyomede
Copy link

khalyomede commented May 20, 2023

I build this image

FROM php:8.1-cli

RUN apt-get update
RUN apt-get install -y git libzip-dev zip

RUN docker-php-ext-install zip

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

COPY . /src
WORKDIR /src

# install the dependencies
RUN composer install -o --prefer-dist && chmod a+x expose

ENV port=8080
ENV domain=localhost
ENV username=username
ENV password=password
ENV exposeConfigPath=/src/config/expose.php

COPY docker-entrypoint.sh /usr/bin/
RUN chmod 755 /usr/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]

With this command:

docker compose run expose share http://localhost

And I get this error

 => [stage-0  2/10] RUN apt-get update                                                                                                                                   3.7s
 => [stage-0  3/10] RUN apt-get install -y git libzip-dev zip                                                                                                            5.4s
 => [stage-0  4/10] RUN docker-php-ext-install zip                                                                                                                       7.2s
 => [stage-0  5/10] COPY --from=composer:latest /usr/bin/composer /usr/bin/composer                                                                                      0.0s
 => [stage-0  6/10] COPY . /src                                                                                                                                          0.1s
 => [stage-0  7/10] WORKDIR /src                                                                                                                                         0.0s
 => ERROR [stage-0  8/10] RUN composer install -o --prefer-dist && chmod a+x expose                                                                                      0.4s
------
 > [stage-0  8/10] RUN composer install -o --prefer-dist && chmod a+x expose:
#0 0.361 Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
#0 0.361 Do not run Composer as root/super user! See https://getcomposer.org/root for details
#0 0.363 Composer could not find a composer.json file in /src
#0 0.363 To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage
------
failed to solve: executor failed running [/bin/sh -c composer install -o --prefer-dist && chmod a+x expose]: exit code: 1

OS

PRETTY_NAME="Ubuntu 22.04 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Docker Compose version v2.6.0

Docke version

Client: Docker Engine - Community
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 23:02:46 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.11
  Git commit:       a89b842
  Built:            Mon Jun  6 23:00:51 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.6
  GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc:
  Version:          1.1.2
  GitCommit:        v1.1.2-0-ga916309
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
@Guidestone31
Copy link

Hi @khalyomede I have the same problem have you find more help since your request ?

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