You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a shim that remaps volume mounts when running docker on docker. Aimed to fix <https://stackoverflow.com/questions/31381322> with no hassle.
4
+
5
+
## Compare it yourself
6
+
7
+
Using the [`fixdockergid`](https://github.com/felipecrs/fixdockergid) image to test, where the `/usr/local/bin/fixdockergid` is only available within the container:
8
+
9
+
```bash
10
+
# This does not work
11
+
docker run --rm -u "$(id -u):$(id -g)" -v /var/run/docker.sock:/var/run/docker.sock felipecrs/fixdockergid docker run --rm -v /usr/local/bin/fixdockergid:/fixdockergid ubuntu test -f /fixdockergid
12
+
13
+
# A non-zero exit code indicates that it did not work
14
+
echo$?
15
+
16
+
# This does
17
+
docker run --rm -u "$(id -u):$(id -g)" -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/felipecrs/dond-shim docker run --rm -v /usr/local/bin/fixdockergid:/fixdockergid ubuntu test -f /fixdockergid
18
+
19
+
# A zero exit code indicates that it worked
20
+
echo$?
21
+
```
22
+
23
+
## Installation
24
+
25
+
Considering your container already has the `docker` CLI installed at `/usr/bin/docker`:
26
+
27
+
```dockerfile
28
+
FROM my-image-with-docker-cli
29
+
30
+
USER root
31
+
32
+
ARG DOCKER_PATH="/usr/bin/docker"
33
+
ARG DOND_SHIM_REVISION="main"
34
+
RUN mv -f "${DOCKER_PATH}""${DOCKER_PATH}.orig" && \
0 commit comments