Open sovetski opened 2 months ago
I think devcontainer features in general only address the installation of additional packages / tools to the base image. So, like other devcontainer features, you can only select different version or different way of install a package. The setting of default credential for MySQL seems like out of scope of devcontainer features. However, to achieve this, you can try to use postCreateCommand
of devcontainer.
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/shyim/devcontainers-features/php:0": {
"version": 8.1
},
"ghcr.io/devcontainers-contrib/features/mysql-homebrew:1": {},
},
"postCreateCommand": "mysqladmin -u root password 123456"
}
where the user name is root
and password is 123456
. This command run only once, when the devcontainer is created
Requested Feature
Hi,
My
devcontainer.json
is:The problem here with MYSQL, is that I don't know what are default credentials for MYSQL, to be able to connect to the database.
Thanks in advance