User Guide: Create a Custom Container¶
To build a custom container you need to first define a Dockerfile, which is a specification that describes how to build a docker container image. https://docs.docker.com/build/concepts/dockerfile/ . Read more about building docker images here: https://docs.docker.com/get-started/docker-concepts/building-images/
Sample Dockerfile¶
The following code snippet is a minimal Dockerfile you can adapt for your custom analysis needs. You can modify the python version, and the pip dependencies and versions to install in the container.
# Change to a different python version if needed
# See available versions here: https://hub.docker.com/_/python/tags
FROM python:3.13.5
# Specify the pip dependencies you need here
RUN python -m pip install \
numpy==2.0.0 \
pandas \
matplotlib
- needs
pythonprogram
Create a file named Dockerfile somewhere in your local code folder. To build this container, run the following command in the same directory as this Dockerfile:
docker build -t <container>:latest --platform linux/amd64 .
Replace
Platform
The --platform linux/amd64 is necessary when building a custom docker container image for IDEAS, which only supports execution for linux amd64 architecture. Your computer does not need to have this same architecture, only the container image is required to have this architecture. Other options for docker build are optional, read more here: https://docs.docker.com/reference/cli/docker/buildx/build/
Sample Makefile¶
Instead of typing out the docker build command every time you need to update the container, copy this Makefile to the same directory as the Dockerfile:
VERSION=latest
IMAGE_TAG=<container>:${VERSION}
PLATFORM=linux/amd64
.PHONY: build
build:
@echo "Building docker image..."
docker build . -t $(IMAGE_TAG) \
--platform ${PLATFORM}
Again, replace make build
Configure Tools for Custom Container¶
To use a custom container within a local tool, run the following command:
ideas tools configure <key>
If this is the first time you’re configuring this tool, follow the input prompts. When asked if you want to download a container from IDEAS, select no (n), and choose a local docker container image.
Publish to IDEAS¶
After testing your tool locally with the custom container, before publishing the tool changes to IDEAS, you need to first publish the custom container to IDEAS, so that it can be available for execution in the cloud. To publish a container to IDEAS, run the following CLI command:
ideas containers publish <container>:<version> \
--description "short description" \
--readme path/to/readme.md \
--label v1 \
--tag python --tag stats --tag behavior
Option
Description
--description
A short description of the container image. This will appear in the container library for others in your org to read in order to understand the container image.
--readme
Optional longer description of the container image. This is a local markdown file, which describes the contents of the container in detail. This is a good place to document dependencies installed in the container image, as well as language and operating system versions
--label
Optional label to assign the container image on IDEAS. This corresponds to the docker container image tag for the image which is used in the cloud.
--tag
Optional tags to assign the container image on IDEAS, which can be used to search and filter the container image on IDEAS.
Once the container has been published, navigate to the container library and verify your custom container is visible on IDEAS.