@@ -16,6 +16,12 @@ You can read more about this topic by running a simple Google search for
1616[ ` "run docker in docker" ` ] ( https://www.google.com/search?q=run+docker+in+docker ) .
1717:::
1818
19+ Throughout this page, we will refer to the diagram below which illustrates the basic
20+ Docker architecture.
21+ The subsequent sections might present a partial perspective of the complete architecture.
22+
23+ ![ Docker architecture] ( /docker/architecture.png )
24+
1925## Docker In Docker
2026
2127Docker In Docker * (also known as dind)* allows developers to run a Docker container within
@@ -45,6 +51,8 @@ docker run \
4551
4652### 2. Mounting the Docker Socket From the Host
4753
54+ ![ Host mount] ( /docker/host-mount.png )
55+
4856``` sh{2}
4957docker run \
5058 -v /var/run/docker.sock:/var/run/docker.sock:ro \
@@ -53,6 +61,8 @@ docker run \
5361
5462### 3. Connect to a Remote Host * (TCP)*
5563
64+ ![ TCP] ( /docker/tcp.png )
65+
5666Assuming you have access to a remote host running docker, you can set the value of
5767` DOCKER_HOST ` as follows:
5868
@@ -67,6 +77,8 @@ pregenerated key-pairs.
6777
6878### 4. Connect to a Remote Host * (SSH)*
6979
80+ ![ SSH] ( /docker/ssh.png )
81+
7082Assuming you have SSH access to a [ remote host running docker] [ protect-ssh ] , you can set
7183the value of ` DOCKER_HOST ` as follows:
7284
@@ -80,7 +92,9 @@ This method is optimized by the workspace as we internally configure a persisten
8092` ssh-agent ` behind the scenes for a quicker connection experience.
8193For more information, visit our documentation on [ ` ssh ` ] ( /tools/ssh )
8294
83- ### 5. Use [ ` docker:dind ` ] [ ] Running on a Remote Host
95+ ### 5. Use [ ` docker:dind ` ] [ dind ] Running on a Remote Host
96+
97+ ![ DIND] ( /docker/dind.png )
8498
8599This process is split into 3 steps:
86100
@@ -98,6 +112,7 @@ This process is split into 3 steps:
98112 --privileged \
99113 --name dind \
100114 --net dind \
115+ -v workspace:/workspace:ro \
101116 -e DOCKER_TLS_CERTDIR=" " \
102117 docker:dind
103118 ` ` `
@@ -107,6 +122,7 @@ This process is split into 3 steps:
107122 ` ` ` sh
108123 docker run \
109124 -e DOCKER_HOST=tcp://dind:2375 \
125+ -v workspace:/workspace \
110126 --net dind \
111127 ghcr.io/kloudkit/workspace:latest
112128 ` ` `
@@ -132,6 +148,6 @@ docker run \
132148 ghcr.io/kloudkit/workspace:latest
133149` ` `
134150
135- [` docker: dind` ]: https://hub.docker.com/_/docker/tags? page=1& name=dind
151+ [dind]: https://hub.docker.com/_/docker/tags? page=1& name=dind
136152[protect-tls]: https://docs.docker.com/engine/security/protect-access/# use-tls-https-to-protect-the-docker-daemon-socket
137153[protect-ssh]: https://docs.docker.com/engine/security/protect-access/# use-ssh-to-protect-the-docker-daemon-socket
0 commit comments