@@ -56,7 +56,6 @@ Ensure you've run the login command above to authenticate with the Docker
5656registry.
5757
5858``` shell
59- NONROOT_USER=${USER}
6059RHEL_VERSION=9.6
6160GCC_VERSION=13
6261CONAN_VERSION=2.18.0
@@ -71,7 +70,6 @@ docker buildx build . \
7170 --build-arg CONAN_VERSION=${CONAN_VERSION} \
7271 --build-arg GCC_VERSION=${GCC_VERSION} \
7372 --build-arg GCOVR_VERSION=${GCOVR_VERSION} \
74- --build-arg NONROOT_USER=${NONROOT_USER} \
7573 --build-arg RHEL_VERSION=${RHEL_VERSION} \
7674 --tag ${CONTAINER_REGISTRY} /${CONTAINER_IMAGE}
7775```
@@ -82,7 +80,6 @@ Ensure you've run the login command above to authenticate with the Docker
8280registry.
8381
8482``` shell
85- NONROOT_USER=${USER}
8683RHEL_VERSION=9.6
8784CONAN_VERSION=2.18.0
8885GCOVR_VERSION=8.3
@@ -95,7 +92,6 @@ docker buildx build . \
9592 --build-arg BUILDKIT_INLINE_CACHE=1 \
9693 --build-arg CONAN_VERSION=${CONAN_VERSION} \
9794 --build-arg GCOVR_VERSION=${GCOVR_VERSION} \
98- --build-arg NONROOT_USER=${NONROOT_USER} \
9995 --build-arg RHEL_VERSION=${RHEL_VERSION} \
10096 --tag ${CONTAINER_REGISTRY} /${CONTAINER_IMAGE}
10197```
@@ -107,29 +103,17 @@ can do so with the following command:
107103
108104``` shell
109105CODEBASE=< path to the rippled repository>
110- docker run --rm -it -v ${CODEBASE} :/rippled ${CONTAINER_REGISTRY} /${CONTAINER_IMAGE}
106+ docker run --user $( id -u ) : $( id -g ) -- rm -it -v ${CODEBASE} :/rippled ${CONTAINER_REGISTRY} /${CONTAINER_IMAGE}
111107```
112108
113- Once inside the container you can run the following commands to build ` rippled ` :
109+ Note, the above command will assume the identity of the current user in the newly created Docker container.
110+ ** This might be exploited by other users with access to the same host (docker instance)** .
114111
115- ``` shell
116- BUILD_TYPE=Debug
117- cd /rippled
118- # Remove any existing data from previous builds on the host machine.
119- rm -rf CMakeCache.txt CMakeFiles build || true
120- # Install dependencies via Conan.
121- conan install . --build missing --settings build_type=${BUILD_TYPE} \
122- -o xrpld=True -o tests=True -o unity=True
123- # Configure the build with CMake.
124- cd build
125- cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
126- -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ..
127- # Build and test rippled. Setting the parallelism too high, e.g. to $(nproc),
128- # can result in an error like "gmake[2]: ...... Killed".
129- PARALLELISM=2
130- cmake --build . -j ${PARALLELISM}
131- ./rippled --unittest --unittest-jobs ${PARALLELISM}
132- ```
112+ The recommended practice is to run Docker in [ rootless mode] ( https://docs.docker.com/engine/security/rootless/ ) ,
113+ or use alternative container runtime such as [ podman] ( https://docs.podman.io/en/latest/ ) which
114+ support [ rootless environment] ( https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md ) .
115+ This will have similar effect as ` --user $(id -u):$(id -g) ` (making this option redundant and invalid),
116+ while also securiting the container from other users on the same host.
133117
134118#### Pushing the Docker image to the GitHub registry
135119
0 commit comments