Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,462,699
Community Members
 
Community Events
176
Community Groups

How to run Lando in Pipelines

I am trying to use Lando in my Bitbucket Pipelines to run my automated tests, but I am unable to get Lando to successfully start.  The problem I'm wrestling with is that as a `root` user I have access to the Docker Daemon, but when I switch to the `pipelines` user to try and start Lando, I am presented with:
```

Unhandled rejection Error: Could not automatically start the Docker Daemon. Please manually start it to continue.

```

The reason I am trying to run Lando as the `pipelines` user is Lando is specifically designed NOT to run as `root`: https://github.com/lando/lando/issues/545

I have tried adding the `pipelines` user to the `docker` user group per both the Docker and Lando documentation, but that does not seem to give me enough access to the Docker Daemon to the point where Lando will successfully start.

https://docs.docker.com/engine/install/linux-postinstall/
* https://docs.lando.dev/basics/installation.html#linux

 

My `bitbucket-pipelines.yml` file:

```

image:
name: libertyconcepts/bitbucket-pipelines-lando:1.0
run-as-user: 1000

definitions:
services:
docker:
memory: 3072

pipelines:
branches:
bitbucket-pipelines:
- step:
name: 'Deployment test on pipelines branch'
script:
- whoami
- groups pipelines
- docker info
- docker version
- lando version
services:
- docker

 Has anyone been able to successfully implement Lando in Pipelines, and if so, what am I missing?

 

 

1 answer

0 votes

Hi @Gabriel Connolly ,

I've done some investigation on this issue, using a bitbucket-pipelines.yml file similar to yours that also tries to start a Lando app. I've been able to reproduce this issue in Pipelines, and a colleague of mine has also reproduced this issue when debugging it locally with Docker.

If we try to run, for testing purposes, a 'docker run' command in the build (the same build that is running as 'pipelines' user), the command is successful. This indicates that the build can connect to the docker(daemon) service when running as 'pipelines' user, and the issue doesn't seem to be related to the permissions of this user.

We also added flags for verbose output in both 'lando init' and 'lando start' commands. The verbose output of 'lando init' is showing that this command can detect the docker engine (the following is part of the output of 'lando init' with '-vvv' flag):

lando 03:33:03 VERBOSE ==> docker-engine exists: true 
lando 03:33:03 VERBOSE ==> docker-compose exists: true

However, based on the output of the 'lando start' command that you also posted here

Unhandled rejection Error: Could not automatically start the Docker Daemon. Please manually start it to continue.

it looks that 'lando start' is trying to start its own docker daemon instead of connecting to the existing docker (daemon) service.

It looks that the issue here has to do with the 'lando start' command. Our suggestion would be to reach out to Lando support team to investigate further why 'lando start' is trying to start its own docker daemon instead of connecting to the existing docker (daemon) service. A little background that you can share with Lando support team is that Pipelines set up Docker daemon as a separate container and then attach the port and socket to the main build container, which allows docker client to connect to docker daemon.

If you need any further info from us, please feel free to let me know.

Kind regards,
Theodora

Thanks for the reply, @Theodora Boudale !  I'll see if I can work wit the Lando team/community to continue to troubleshoot this, and then bring my findings back here.

You're very welcome Gabriel! Please feel free to post your findings here and also let me know if you need any further info.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events