spurin / diveintoansible-lab

Dive Into Ansible Lab
788 stars 498 forks source link

Ubuntu containers exit with error 255 on Windows 10 #49

Closed vanzod closed 3 years ago

vanzod commented 3 years ago

I have attempted to deploy the Ansible Lab under Windows 10 with Docker Desktop 3.5.2.

When executing docker-compose up on WSL2 all Ubuntu containers fail with error code 255. All CentOS containers start successfully. If I attempt to run the Ubuntu container with docker run it starts without issues.

Unfortunately docker-compose does not provide any additional output other than the error codes.

spurin commented 3 years ago

Hi @vanzod

Are you by any chance using the Ubuntu subsystem?

If so, the issue here is owing to this not having systemd. It’s a stripped down version of Ubuntu. The containers, all leverage systemd and when they try to use the parents subsystem, this is missing. We can work around this by just creating the required components that are needed.

Could you run the following, before doing the docker-compose up

sudo mkdir -p /sys/fs/cgroup/systemd

sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd

Then try starting the lab. Please let me know how you get on πŸ‘

vanzod commented 3 years ago

Hi @spurin

Thanks for the quick reply!

Yes, I am running Debian as subsystem. I applied your fix and now it works like a charm!

I am going ahead and close this issue.

Thanks again!

spurin commented 3 years ago

Awesome, thanks @vanzod

Hope you enjoy the rest of the course πŸ˜πŸ‘

carlosdoliveira commented 2 years ago

Awesome, thanks @vanzod

Hope you enjoy the rest of the course πŸ˜πŸ‘

Sorry for re-opening this issue, but I just wanted to suggest adding this note on the README.md, I've got the same issue and your comment just saved me πŸ˜„.

spurin commented 2 years ago

Very good idea, I'll aim to get the readme updated today!

spurin commented 2 years ago

Hi @carlosdoliveira

Updated as promised. Have a look and let me know if you think this covers this off sufficiently.

Thanks!

James Spurin