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

Cannot create container for service - many of them #84

Open
jramiresbrito opened this issue Jan 3, 2022 · 4 comments
Open

Cannot create container for service - many of them #84

jramiresbrito opened this issue Jan 3, 2022 · 4 comments

Comments

@jramiresbrito
Copy link

After following the setup instructions, I've successfully installed it using docker-compose run composer create-project.
Then, in the next step, to run the containers, docker complains about the name of the containers:

Creating -composer ... error

ERROR: for -composer  Cannot create container for service composer: Invalid container name (-composer), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed

ERROR: for mailhog  Cannot create container for service mailhog: Invalid container name (-mailhog), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed

ERROR: for mysql  Cannot create container for service mysql: Invalid container name (-mysql), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed

ERROR: for composer  Cannot create container for service composer: Invalid container name (-composer), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed

the thing is the composer can't find the environment variables set in .env file and it defaults to a blank string:

WARNING: The APP_NAME variable is not set. Defaulting to a blank string.
WARNING: The DOMAIN variable is not set. Defaulting to a blank string.
WARNING: The DB_ROOT_PASSWORD variable is not set. Defaulting to a blank string.

How to make it work?

PS: Sorry about the off-topic. In the step of adding the domain to the hosts file, I've overridden the old entry:

127.0.0.1 localhost

to

127.0.0.1 myapp.local

Is that correct, or should I just add another entry?

@RobHowdle
Copy link

Hello,

It cannot find .env because I suspect you haven't created it. I had this same issue and each time I had to manually create the .env file. Perhaps there is something wrong with the create script as it creates one .env but I believe it doesn't create the root .env. Try duplicating the root .env.example and renaming to .env and then run the create-project command again.

Also with your domain question, just add another entry, don't think there is any need to override anything.

Hope this helps

@jramiresbrito
Copy link
Author

I have it created. Actually I've just removed the .example from all extensions here's my tree

.
├── certs
│   ├── alquimia.local-key.pem
│   └── alquimia.local.pem
├── cli
│   └── create-cert.sh
├── config
│   ├── php.ini
│   └── phpmyadmin.ini
├── docker-compose.yml
├── Dockerfile
├── .env
├── .git
│   ├── branches
│   ├── config
│   ├── description
│   ├── HEAD
│   ├── hooks
│   ├── index
│   ├── info
│   ├── logs
│   ├── objects
│   ├── packed-refs
│   └── refs
├── .gitignore
├── nginx
│   └── default.conf.conf
├── README.md
├── src
│   ├── CHANGELOG.md
│   ├── composer.json
│   ├── composer.lock
│   ├── config
│   ├── .env
│   ├── .github
│   ├── .gitignore
│   ├── LICENSE.md
│   ├── phpcs.xml
│   ├── README.md
│   ├── vendor
│   ├── web
│   └── wp-cli.yml
└── .travis.yml

16 directories, 26 files

@urre
Copy link
Owner

urre commented Jan 9, 2022

@jramiresbrito what does your .env file in the root folder look like? You need that also, not just the src/.env

@toshuyu
Copy link

toshuyu commented Nov 6, 2023

@jramiresbrito you need to run both docker-compose run composer create-project and docker-compose up at the root of the project (not under /cli folder for example)

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

4 participants