@@ -37,7 +37,6 @@ Ensure you've run the login command above to authenticate with the Docker
3737registry.
3838
3939``` shell
40- NONROOT_USER=${USER}
4140DEBIAN_VERSION=bookworm
4241GCC_VERSION=12
4342CONAN_VERSION=2.18.0
@@ -53,7 +52,6 @@ docker buildx build . \
5352 --build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \
5453 --build-arg GCC_VERSION=${GCC_VERSION} \
5554 --build-arg GCOVR_VERSION=${GCOVR_VERSION} \
56- --build-arg NONROOT_USER=${NONROOT_USER} \
5755 --tag ${CONTAINER_REGISTRY} /${CONTAINER_IMAGE}
5856```
5957
@@ -63,7 +61,6 @@ Ensure you've run the login command above to authenticate with the Docker
6361registry.
6462
6563``` shell
66- NONROOT_USER=${USER}
6764DEBIAN_VERSION=bookworm
6865CLANG_VERSION=17
6966CONAN_VERSION=2.18.0
@@ -79,7 +76,6 @@ docker buildx build . \
7976 --build-arg CONAN_VERSION=${CONAN_VERSION} \
8077 --build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \
8178 --build-arg GCOVR_VERSION=${GCOVR_VERSION} \
82- --build-arg NONROOT_USER=${NONROOT_USER} \
8379 --tag ${CONTAINER_REGISTRY} /${CONTAINER_IMAGE}
8480```
8581
@@ -90,9 +86,18 @@ can do so with the following command:
9086
9187``` shell
9288CODEBASE=< path to the rippled repository>
93- docker run --rm -it -v ${CODEBASE} :/rippled ${CONTAINER_REGISTRY} /${CONTAINER_IMAGE}
89+ docker run --user $( id -u ) : $( id -g ) -- rm -it -v ${CODEBASE} :/rippled ${CONTAINER_REGISTRY} /${CONTAINER_IMAGE}
9490```
9591
92+ Note, the above command will assume the identity of the current user in the newly created Docker container.
93+ ** This might be exploited by other users with access to the same host (docker instance)** .
94+
95+ The recommended practice is to run Docker in [ rootless mode] ( https://docs.docker.com/engine/security/rootless/ ) ,
96+ or use alternative container runtime such as [ podman] ( https://docs.podman.io/en/latest/ ) which
97+ support [ rootless environment] ( https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md ) .
98+ This will have similar effect as ` --user $(id -u):$(id -g) ` (making this option redundant and invalid),
99+ while also securing the container from other users on the same host.
100+
96101Once inside the container you can run the following commands to build ` rippled ` :
97102
98103``` shell
@@ -113,7 +118,6 @@ PARALLELISM=2
113118cmake --build . -j ${PARALLELISM}
114119./rippled --unittest --unittest-jobs ${PARALLELISM}
115120```
116- ```
117121
118122#### Pushing the Docker image to the GitHub registry
119123
0 commit comments