Skip to content

Commit e342cfc

Browse files
authored
Add docs about how to use docker for when autogen itself is run in docker (#2052)
1 parent 3a3d4cc commit e342cfc

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

website/docs/topics/code-execution/cli-code-executor.ipynb

+20-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@
5757
" )"
5858
]
5959
},
60+
{
61+
"cell_type": "markdown",
62+
"metadata": {},
63+
"source": [
64+
"### Combining AutoGen in Docker with a Docker based executor\n",
65+
"\n",
66+
"It is desirable to bundle your AutoGen application into a Docker image. But then, how do you allow your containerised application to execute code in a different container?\n",
67+
"\n",
68+
"The recommended approach to this is called \"Docker out of Docker\", where the Docker socket is mounted to the main AutoGen container, so that it can spawn and control \"sibling\" containers on the host. This is better than what is called \"Docker in Docker\", where the main container runs a Docker daemon and spawns containers within itself. You can read more about this [here](https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/).\n",
69+
"\n",
70+
"To do this you would need to mount the Docker socket into the AutoGen container. This can be done by adding the following to the `docker run` command:\n",
71+
"\n",
72+
"```bash\n",
73+
"-v /var/run/docker.sock:/var/run/docker.sock\n",
74+
"```\n",
75+
"\n",
76+
"This will allow the AutoGen container to spawn and control sibling containers on the host."
77+
]
78+
},
6079
{
6180
"cell_type": "markdown",
6281
"metadata": {},
@@ -354,7 +373,7 @@
354373
"name": "python",
355374
"nbconvert_exporter": "python",
356375
"pygments_lexer": "ipython3",
357-
"version": "3.11.7"
376+
"version": "3.11.8"
358377
}
359378
},
360379
"nbformat": 4,

website/docs/topics/code-execution/jupyter-code-executor.ipynb

+8-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@
129129
"EXPOSE 8888\n",
130130
"\n",
131131
"WORKDIR \"${HOME}\"\n",
132-
"```\n"
132+
"```\n",
133+
"\n",
134+
"````{=mdx}\n",
135+
":::tip\n",
136+
"To learn about how to combine AutoGen in a Docker image while also executing code in a separate image go [here](/docs/topics/code-execution/cli-code-executor#combining-autogen-in-docker-with-a-docker-based-executor).\n",
137+
":::\n",
138+
"````"
133139
]
134140
},
135141
{
@@ -444,7 +450,7 @@
444450
"name": "python",
445451
"nbconvert_exporter": "python",
446452
"pygments_lexer": "ipython3",
447-
"version": "3.11.7"
453+
"version": "3.11.8"
448454
}
449455
},
450456
"nbformat": 4,

0 commit comments

Comments
 (0)