Skip to content

Commit

Permalink
ansible,docker: ensure <1024 are privileged ports
Browse files Browse the repository at this point in the history
Since Docker 20.10.0 @ 2020-12-08, port binding has been made unrestricted.
This change undoes that by ensuring that <1024 are privileged. Node.js' test
suite assumes that binding to a lower port will result in a privilege failure
so we need to create an environment suitable for that assumption.

Ref: nodejs/node#36847
  • Loading branch information
rvagg committed Jan 9, 2021
1 parent 48a9ac2 commit eb9e46d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ansible/roles/docker/templates/jenkins.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WantedBy=multi-user.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/docker run --init --rm -v /home/{{ server_user }}/{{ item.name }}/:/home/{{ server_user }} -v /home/{{ server_user }}/.ccache/:/home/{{ server_user }}/.ccache --name node-ci-{{ item.name }} node-ci:{{ item.name }}
ExecStart=/usr/bin/docker run --init --rm -v /home/{{ server_user }}/{{ item.name }}/:/home/{{ server_user }} -v /home/{{ server_user }}/.ccache/:/home/{{ server_user }}/.ccache --name node-ci-{{ item.name }} --sysctl net.ipv4.ip_unprivileged_port_start=1024 node-ci:{{ item.name }}
ExecStop=/usr/bin/docker stop -t 5 node-ci-{{ item.name }}
Restart=always
RestartSec=30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WantedBy=multi-user.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/docker run --init --rm -v /home/{{ server_user }}:/home/{{ server_user }} --name node-ci-{{ item.name }} node-ci:{{ item.name }}
ExecStart=/usr/bin/docker run --init --rm -v /home/{{ server_user }}:/home/{{ server_user }} --name node-ci-{{ item.name }} --sysctl net.ipv4.ip_unprivileged_port_start=1024 node-ci:{{ item.name }}
ExecStop=/usr/bin/docker stop -t 5 node-ci-{{ item.name }}
Restart=always
RestartSec=30
Expand Down

0 comments on commit eb9e46d

Please sign in to comment.