lando / mysql

The Official MySQL Lando Plugin
https://docs.lando.dev/mysql/
GNU General Public License v3.0
1 stars 2 forks source link

Adding pv in the docker container #54

Open Bouhnosaure opened 1 month ago

Bouhnosaure commented 1 month ago

Hi,

I have a small issue with long database imports, it takes a long time and I've noticed in the /plugins/@lando/core/scripts/sql-import.sh there is a command that checks if pv is installed and use it if so and if not that defaults to cat which has no output progress.

So I've read the code behind the mysql plugin and i haven't found yet how to add custom commands in order to install pv as you don't control the bitnami's mysql docker containers.

Do you have a way to add it in the build process or a workaround to automate the process of installing pv ?


As a workaround i've done this :

➜  docker ps                                          
CONTAINER ID   IMAGE
343de3e04a02   bitnami/mysql:8.0.19-debian-10-r57                                                   
➜  docker exec -u 0 -it 343de3e04a02 sh -c "apt update && apt install pv -y"

Hope it helps !

Thanks,

Alex

AaronFeledy commented 1 month ago

You can define build steps that Lando will execute when it's building the environment. Just put your apt commands in build steps and run lando rebuild: https://docs.lando.dev/core/v3/services/lando.html#build-steps