Skip to content

robco/docker-robot-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

71 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

"Buy Me A Coffee"

Robot Framework Multi-Platform Docker Image

Docker Pulls Multi-Platform Support Python Version Robot Framework

A hardened, multi-platform Docker image for running Robot Framework test automation across x64 and ARM architectures (including Apple Silicon). This image provides a secure, portable environment for test execution with built-in support for performance testing tools.

🌟 Features

  • Multi-Architecture Support: Runs seamlessly on x64, ARM, and Apple Silicon
  • Hardened Security: Built on Docker's official hardened Python base image
  • Pre-installed Tools:
    • Robot Framework 7.x
    • Modern Python 3.12 environment
    • Alpine Linux-based for minimal footprint
  • Flexible Execution: Run Robot tests or any custom command
  • Optimized Dependencies: Pre-cached package installation for faster builds

πŸš€ Quick Start

Basic Robot Framework Execution

docker run --rm -v $(pwd):/robot malovec/robot-runner:latest tests/suite.robot

Interactive Shell Access

docker run --rm -ti -e CMD=bash malovec/robot-runner:latest

πŸ“¦ Image Contents

Pre-installed Packages

Python Libraries:

  • Robot Framework 7.x
  • Browser and SeleniumLibrary for web testing
  • Appium Library for mobile testing
  • Requests library for API testing
  • All major Robot Framework ecosystem packages

System Tools:

  • Node.js/npm packages for modern web testing
  • Alpine Linux system dependencies

πŸ› οΈ Usage Examples

1. Run Robot Tests with Output Directory

docker run --rm                                                   \
  -v $(pwd):/robot                                                \
  malovec/robot-runner:latest                                     \
  --outputdir results tests/

2. Run Specific Robot Suite with Variables

docker run --rm                                                   \
  -v $(pwd):/robot                                                \
  malovec/robot-runner:latest                                     \
  --variable BROWSER:chrome                                       \
  --suite smoke_tests tests/suite.robot

3. Run Custom Python Scripts

docker run --rm                                                  \
  -v $(pwd):/robot                                               \
  -e CMD=python                                                  \
  malovec/robot-runner:latest                                    \
  my_script.py

πŸ”§ Advanced Configuration

Volume Mounts for Data Persistence

# Mount current directory and specific output directory
docker run --rm                                                  \
  -v $(pwd)/tests:/robot/tests                                   \
  -v $(pwd)/results:/robot/results                               \
  malovec/robot-runner:latest                                    \
  --outputdir /robot/results /robot/tests

Environment Variable Configuration

docker run --rm                                                  \
  -v $(pwd):/robot                                               \
  -e PYTHONPATH=/robot/lib                                       \
  -e ROBOT_OPTIONS="--loglevel DEBUG"                            \
  malovec/robot-runner:latest

Docker Compose Integration

version: '3.8'
services:
  robot-tests:
    image: malovec/robot-runner:latest
    volumes:
      - ./tests:/robot/tests
      - ./results:/robot/results
    command: --outputdir /robot/results /robot/tests/smoke.robot

πŸ—οΈ Building from Source

Build for Multiple Architectures

# Build for both x64 and ARM
docker buildx build --platform linux/amd64,linux/arm64           \
  -t malovec/robot-runner:latest                                 \
  --push .

Custom Python Version

# Build with specific Python version
docker build --build-arg DHI_PYTHON_BUILD_TAG=3.11-alpine3.22-dev \
  -t my-robot-runner:custom .

πŸ”’ Security Features

  • Built on Docker's hardened Python base image
  • Non-root user execution support
  • Minimal Alpine Linux base for reduced attack surface
  • Regular security updates from upstream bases
  • Python bytecode writing disabled (PYTHONDONTWRITEBYTECODE=1)

πŸ“‹ Requirements File Structure

The image uses a structured approach for dependencies:

requirements/
β”œβ”€β”€ apk.in      # Alpine Linux packages
β”œβ”€β”€ npm.in      # Node.js packages  
└── python.in   # Python packages

πŸ“„ License

This project is open source. Please check the respective licenses for included tools:

  • Robot Framework: Apache License 2.0
  • Python: Python Software Foundation License

πŸ”— Links


Built with ❀️ for the Robot Framework community

About

RobotFramework docker image

Resources

License

Stars

Watchers

Forks

Sponsor this project