Categories:
Docker image
Description of how to create agent images, which is necessary for future deployment.
Introduction
The Docker image is the necessary component to deploy the agent in the ATRIA environment.
The image is built from the agent package and agent-server, which contains all the necessary to run the agent-server.
Build agent image
To build the agent image, it is necessary to use the docker command with the build option.
docker build -t <image_name> .
Where:
<image_name>: Name of the image to be created..: It indicates that the Dockerfile is in the current directory.
Dockerfile
The Dockerfile is the file that contains the instructions to build the image.
The Dockerfile for the agent image is located in the root directory of the agent package.
It is structured in two stages:
- The first stage builds the agent package
- The second stage creates the final image with the necessary dependencies and configurations and run the agent-server.
FROM python:3.13-slim AS base
ADD packages/atria-agent-dummy /opt/atria-agent
WORKDIR /opt/atria-agent
RUN pip install -r dev-requirements.txt && \
python -m build
FROM python:3.13-slim
WORKDIR /opt/atria-agent
RUN apt-get update && apt-get install gcc python3-dev -y
COPY --from=base /opt/atria-agent/dist/atria_agent_dummy-*.tar.gz .
COPY --from=base /opt/atria-agent/entrypoint.sh entrypoint.sh
COPY --from=base /opt/atria-agent/version.txt version.txt
RUN pip install atria_agent_dummy-*.tar.gz && rm atria_agent_dummy-*.tar.gz
ENV AGENT_PACKAGE_NAME=atria_agent_dummy
ENTRYPOINT ["./entrypoint.sh"]
The directory atria-agent-dummy is the agent package that contains the agents code.
The entrypoint.sh script is used to run the agent server with the necessary configurations.
#!/bin/bash
set -e
export AURA_LOGGING_MODULE_VERSION=$(cat /opt/atria-agent/version.txt)
python -m atria_agents_server