DEV Community

tarohida
tarohida

Posted on

docker-compose `/docker-entrypoint.sh: exec: line 24: require: not found`

Environment

  • Ubuntu 18.04 LTS
  • Docker Composer Container

Problem

run follow command.

docker-compose run composer require phpunit/phpunit
Enter fullscreen mode Exit fullscreen mode

got error.

/docker-entrypoint.sh: exec: line 24: require: not found
Enter fullscreen mode Exit fullscreen mode

How to solve it.

remove composer.json file.

$ rm ./composer.json 
Enter fullscreen mode Exit fullscreen mode

and re-run. succeeded.

docker-compose run composer require phpunit/phpunit
Enter fullscreen mode Exit fullscreen mode

Description.

when I run --help command, i got Execption Output.

$ docker-compose run composer --help


  [Seld\JsonLint\ParsingException]                                        
  "./composer.json" does not contain valid JSON                           
  Parse error on line 1:                                                  

  ^                                                                       
  Expected one of: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['  

Enter fullscreen mode Exit fullscreen mode

composer.json file is empty.

$ cat ./composer.json
$
Enter fullscreen mode Exit fullscreen mode

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay