Running a Docker container in a separate cell
Warning
The Serverlesss mode will be discontinued on March 1, 2024.
When using Serverlesss mode, you can set up a separate environment in any notebook cell by running a Docker container in it. You can utilize this method if you need to use a utility distributed as a Docker image or a programming language other than Python. The launchable image can be located in any open Docker image registry.
Note
Custom images created in a project are not available to run in a cell.
To start a container, enter the following command in a notebook cell:
#!:docker-run <image_name>
If you need to add computing resources, specify a configuration prefix, such as:
#!g1.1:docker-run <image_name>
For example, the https://hub.docker.com/_/golanggo version
command in this image, run a cell with the following code:
#!:docker-run golang go version
Result:
go version go1.16.6 linux/amd64