Skip to content

Commit c795497

Browse files
authored
Update READMEs to include instructions for mounting Conan cache volume (#77)
This PR mounts a Docker-managed volume where the Conan dependencies can be stored.
1 parent b264954 commit c795497

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
lines changed

docker/debian/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ can do so with the following command:
121121

122122
```shell
123123
CODEBASE=<path to the rippled repository>
124-
docker run --user $(id -u):$(id -g) --rm -it -v ${CODEBASE}:/rippled ${CONTAINER_IMAGE}
124+
docker run --user $(id -u):$(id -g) --rm -it \
125+
--mount type=bind,source=${CODEBASE},target=/rippled \
126+
${CONTAINER_IMAGE}
125127
```
126128

127129
Note, the above command will assume the identity of the current user in the
@@ -140,6 +142,22 @@ If you see an error such as `bash: /root/.bashrc: Permission denied` and the
140142
prompt shows `I have no name!`, then exit the container and run it again without
141143
the `--user $(id -u):$(id -g)` option, or run it in rootless mode.
142144

145+
#### Caching Conan dependencies
146+
147+
You can further customize the `docker run` command by adding a volume mount for
148+
holding the Conan cache (the "p" directory), e.g.:
149+
150+
```shell
151+
docker run --user $(id -u):$(id -g) --rm -it \
152+
--mount type=bind,source=${CODEBASE},target=/rippled \
153+
--mount type=volume,source=conan,target=/root/.conan2/p \
154+
${CONTAINER_IMAGE}
155+
```
156+
157+
This avoids the need to build the dependencies each time you run the image.
158+
159+
#### Building the binary
160+
143161
Once inside the container you can run the following commands to build `rippled`:
144162

145163
```shell

docker/rhel/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ can do so with the following command:
7878

7979
```shell
8080
CODEBASE=<path to the rippled repository>
81-
docker run --user $(id -u):$(id -g) --rm -it -v ${CODEBASE}:/rippled ${CONTAINER_IMAGE}
81+
docker run --user $(id -u):$(id -g) --rm -it \
82+
--mount type=bind,source=${CODEBASE},target=/rippled \
83+
${CONTAINER_IMAGE}
8284
```
8385

8486
Note, the above command will assume the identity of the current user in the
@@ -97,6 +99,22 @@ If you see an error such as `bash: /root/.bashrc: Permission denied` and the
9799
prompt shows `I have no name!`, then exit the container and run it again without
98100
the `--user $(id -u):$(id -g)` option, or run it in rootless mode.
99101

102+
#### Caching Conan dependencies
103+
104+
You can further customize the `docker run` command by adding a volume mount for
105+
holding the Conan cache (the "p" directory), e.g.:
106+
107+
```shell
108+
docker run --user $(id -u):$(id -g) --rm -it \
109+
--mount type=bind,source=${CODEBASE},target=/rippled \
110+
--mount type=volume,source=conan,target=/root/.conan2/p \
111+
${CONTAINER_IMAGE}
112+
```
113+
114+
This avoids the need to build the dependencies each time you run the image.
115+
116+
#### Building the binary
117+
100118
Once inside the container you can run the following commands to build `rippled`:
101119

102120
```shell

docker/ubuntu/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ can do so with the following command:
7979

8080
```shell
8181
CODEBASE=<path to the rippled repository>
82-
docker run --user $(id -u):$(id -g) --rm -it -v ${CODEBASE}:/rippled ${CONTAINER_IMAGE}
82+
docker run --user $(id -u):$(id -g) --rm -it \
83+
--mount type=bind,source=${CODEBASE},target=/rippled \
84+
${CONTAINER_IMAGE}
8385
```
8486

8587
Note, the above command will assume the identity of the current user in the
@@ -98,6 +100,22 @@ If you see an error such as `bash: /root/.bashrc: Permission denied` and the
98100
prompt shows `I have no name!`, then exit the container and run it again without
99101
the `--user $(id -u):$(id -g)` option, or run it in rootless mode.
100102

103+
#### Caching Conan dependencies
104+
105+
You can further customize the `docker run` command by adding a volume mount for
106+
holding the Conan cache (the "p" directory), e.g.:
107+
108+
```shell
109+
docker run --user $(id -u):$(id -g) --rm -it \
110+
--mount type=bind,source=${CODEBASE},target=/rippled \
111+
--mount type=volume,source=conan,target=/root/.conan2/p \
112+
${CONTAINER_IMAGE}
113+
```
114+
115+
This avoids the need to build the dependencies each time you run the image.
116+
117+
#### Building the binary
118+
101119
Once inside the container you can run the following commands to build `rippled`:
102120

103121
```shell

0 commit comments

Comments
 (0)