Add docs about how to use docker for when autogen itself is run in docker (#2052)

This commit is contained in:
Jack Gerrits 2024-03-18 13:13:28 -04:00 committed by GitHub
parent 3a3d4cc2ee
commit e342cfcdb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 3 deletions

View File

@ -57,6 +57,25 @@
" )"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Combining AutoGen in Docker with a Docker based executor\n",
"\n",
"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",
"\n",
"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",
"\n",
"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",
"\n",
"```bash\n",
"-v /var/run/docker.sock:/var/run/docker.sock\n",
"```\n",
"\n",
"This will allow the AutoGen container to spawn and control sibling containers on the host."
]
},
{
"cell_type": "markdown",
"metadata": {},
@ -354,7 +373,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.11.8"
}
},
"nbformat": 4,

View File

@ -129,7 +129,13 @@
"EXPOSE 8888\n",
"\n",
"WORKDIR \"${HOME}\"\n",
"```\n"
"```\n",
"\n",
"````{=mdx}\n",
":::tip\n",
"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",
":::\n",
"````"
]
},
{
@ -444,7 +450,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.11.8"
}
},
"nbformat": 4,