spurin / diveintoansible-lab

Dive Into Ansible Lab
850 stars 531 forks source link

docker-compose up needs port 1000 (privileged port) #46

Closed Skyrant closed 2 years ago

Skyrant commented 3 years ago

People will get an error as i did on Ubuntu 20 LTS. What they need to do is:

Exposing privileged ports To expose privileged ports (< 1024), set CAP_NET_BIND_SERVICE on rootlesskit binary.

sudo setcap cap_net_bind_service=ep $HOME/bin/rootlesskit Or add net.ipv4.ip_unprivileged_port_start=0 to /etc/sysctl.conf (or /etc/sysctl.d) and run sudo sysctl --system.

spurin commented 3 years ago

Thanks for sharing @Skyrant

Will keep this open for now for others who have the same issue. Am currently working on an interactive setup guide for the lab so will make reference to this as a check!

miguelf commented 3 years ago

Can we change the docker-compose.yaml port to 1024 to get around this:

    ports:
     - "1024:80"

That seems to be working for me...

spurin commented 3 years ago

Hi, absolutely fine doing so. At the time, port 1000 seemed like a great idea for visuals but alas, in retrospect a different port would have been better.

On the next major refresh, I'll change this

arkapratimsarkar commented 2 years ago

i didn't got such error. is it because i already added docker group to my local user ? does that matter ? I'm running pop os 21.04 (ubuntu based)

spurin commented 2 years ago

@arkapratimsarkar I think the error mentioned is this issue is variant on the setup and options chosen.

I've deployed some of the newer Linux distros for cgroups v2 testing and haven't encountered it.

In doing so, I have typically done the most minimal install so that most likely relates

spurin commented 2 years ago

Closing this issue for now. Next year, I will be doing an entire refresh of the course (which will be V4 major). During this window, I'll address the change.