From 0b9b10a38e767f46cab57202d679b1d9a8d7e6d7 Mon Sep 17 00:00:00 2001
From: Utz-Uwe Haus <uhaus@cray.com>
Date: Fri, 12 Mar 2021 15:44:54 +0100
Subject: [PATCH] Add comment about gdb usage in docker

CAP_PTRACE is needed for ASLR disable to work, which gdb needs
---
 build-envs/README | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/build-envs/README b/build-envs/README
index 234f7a82..e48c4ffd 100644
--- a/build-envs/README
+++ b/build-envs/README
@@ -25,6 +25,13 @@ Running things by hand
 
   $ docker pull registry.gitlab.com/cerl/maestro/maestro-core/buildenv/debian
   $ docker run --ulimit memlock=133000:133000 -i -t registry.gitlab.com/cerl/maestro/maestro-core/buildenv/debian /bin/bash 
+
+  # but since you're reading this, you may be interested in debugging. In that
+  # case, to permit gdb to work inside the docker container you might want to
+  # use
+  #  docker run --cap-add=SYS_PTRACE --ulimit memlock=133000:133000 -i -t registry.gitlab.com/cerl/maestro/maestro-core/buildenv/debian /bin/bash
+  # instead
+
   # now you have a shell in the docker container that is currently used on gitlab for CI
   $ mkdir /builds
   $ cd /builds
-- 
GitLab