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

Adding pv in the docker container #54

Open
Bouhnosaure opened this issue Jul 26, 2024 · 2 comments
Open

Adding pv in the docker container #54

Bouhnosaure opened this issue Jul 26, 2024 · 2 comments

Comments

@Bouhnosaure
Copy link

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
Copy link
Member

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

@DuaelFr
Copy link

DuaelFr commented Oct 10, 2024

I added this in my .lando.local.yml file and it works after a rebuild but it should be nice to have this built-in.

services:
  database:
    build_as_root:
      - apt update -y && apt install -y pv

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

3 participants