Skip to content

Commit a90185e

Browse files
authored
Update README.md
1 parent f220551 commit a90185e

1 file changed

Lines changed: 155 additions & 69 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 155 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,191 @@
11
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/robco)
2-
# Robot Framework Docker Runner
2+
# Robot Framework Multi-Platform Docker Image
33

4-
A multi-platform Docker image for running Robot Framework tests seamlessly across **x64** and **Apple Silicon/ARM** architectures. Built on Alpine Linux for minimal footprint and maximum performance.
4+
[![Docker Pulls](https://img.shields.io/docker/pulls/malovec/robot-runner)](https://hub.docker.com/r/malovec/robot-runner)
5+
[![Multi-Platform Support](https://img.shields.io/badge/platform-x64%20%7C%20ARM%20%7C%20Apple%20Silicon-blue)](https://hub.docker.com/r/malovec/docker-robot-runner)
6+
[![Python Version](https://img.shields.io/badge/python-3.12-blue)](https://www.python.org/)
7+
[![Robot Framework](https://img.shields.io/badge/Robot%20Framework-7.x-red)](https://robotframework.org/)
58

6-
## Features
9+
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.
710

8-
- **Multi-Architecture Support**: Pre-built images for both `linux/amd64` and `linux/arm64`
9-
- **Batteries Included**: Pre-installed with Robot Framework, browser automation tools, and testing utilities
10-
- **Lightweight**: Based on Alpine Linux for fast downloads and minimal resource usage
11-
- **Production Ready**: Industry-standard security practices and optimized layers
12-
- **Flexible**: Easy to extend with your own test suites and dependencies
11+
## 🌟 Features
1312

14-
## What's Included
13+
- **Multi-Architecture Support**: Runs seamlessly on x64, ARM, and Apple Silicon
14+
- **Hardened Security**: Built on Docker's official hardened Python base image
15+
- **Pre-installed Tools**:
16+
- Robot Framework 6.1+
17+
- Apache JMeter 5.6.3 for performance testing
18+
- Modern Python 3.12 environment
19+
- Alpine Linux-based for minimal footprint
20+
- **Flexible Execution**: Run Robot tests, JMeter scripts, or any custom command
21+
- **Optimized Dependencies**: Pre-cached package installation for faster builds
1522

16-
### Core Components
17-
- **Robot Framework** - Test automation framework
18-
- **Python 3.12** - Modern Python version with full Robot Framework ecosystem
19-
- **JMeter 5.6.3** - Performance testing integration
20-
- **Node.js/NPM** - JavaScript testing capabilities
23+
## πŸš€ Quick Start
2124

22-
### Pre-installed Dependencies
23-
- Browser automation libraries
24-
- API testing tools
25-
- Database connectors
26-
- XML/JSON processing utilities
27-
- And much more!
25+
### Basic Robot Framework Execution
2826

29-
### Project structure
27+
```bash
28+
docker run --rm -v $(pwd):/robot malovec/robot-runner:latest tests/suite.robot
3029
```
31-
.
32-
β”œβ”€β”€ Dockerfile # Multi-stage build configuration
33-
β”œβ”€β”€ requirements/
34-
β”‚ β”œβ”€β”€ apk.in # Alpine Linux packages
35-
β”‚ β”œβ”€β”€ npm.in # Node.js packages
36-
β”‚ └── python.in # Python dependencies
37-
β”œβ”€β”€ scripts/
38-
β”‚ └── install-apk-from-file.sh # Package installation helper
39-
└── entrypoint.sh # Container entrypoint
30+
31+
### Running JMeter Tests
32+
33+
```bash
34+
docker run --rm -v $(pwd):/robot -e CMD=jmeter malovec/robot-runner:latest -n -t Summary-Report.jmx -l Summary-Report.jtl
4035
```
4136

42-
## Quick Start
37+
### Interactive Shell Access
4338

44-
### Run Basic Tests
4539
```bash
46-
docker run --rm -v $(pwd)/tests:/tests malovec/robot-runner:latest -d results /tests/test.robot
40+
docker run --rm -ti -e CMD=bash malovec/robot-runner:latest
4741
```
4842

49-
### Use as Base Image
50-
```dockerfile
51-
FROM malovec/robot-runner:latest
43+
## πŸ“¦ Image Contents
5244

53-
COPY your-tests /robot/tests
54-
COPY requirements /robot/requirements
45+
### Pre-installed Packages
5546

56-
# Add additional dependencies if needed
57-
RUN pip install -r /robot/requirements/python.in
58-
```
47+
**Python Libraries:**
48+
- Robot Framework 7.x
49+
- Browser and SeleniumLibrary for web testing
50+
- Appium Library for mobile testing
51+
- Requests library for API testing
52+
- All major Robot Framework ecosystem packages
53+
54+
**System Tools:**
55+
- Apache JMeter 5.x
56+
- Node.js/npm packages for modern web testing
57+
- Alpine Linux system dependencies
58+
59+
## πŸ› οΈ Usage Examples
60+
61+
### 1. Run Robot Tests with Output Directory
5962

60-
### Custom Command Execution
6163
```bash
62-
# Run specific Robot Framework command
63-
docker run --rm -v $(pwd):/robot malovec/robot-runner:latest -v VARIABLE:value your_test.robot
64+
docker run --rm \
65+
-v $(pwd):/robot \
66+
malovec/robot-runner:latest \
67+
--outputdir results tests/
68+
```
6469

65-
# Execute custom commands
66-
docker run --rm malovec/robot-runner:latest CMD="python -c \"print('Hello from Robot!')\""
70+
### 2. Run Specific Robot Suite with Variables
71+
72+
```bash
73+
docker run --rm \
74+
-v $(pwd):/robot \
75+
malovec/robot-runner:latest \
76+
--variable BROWSER:chrome \
77+
--suite smoke_tests tests/suite.robot
6778
```
6879

69-
## Advanced Usage
80+
### 3. Execute JMeter with Custom Properties
7081

71-
### Multi-stage Build Integration
72-
```dockerfile
73-
# Development stage
74-
FROM malovec/robot-runner:latest as dev
75-
RUN pip install additional-dev-packages
82+
```bash
83+
docker run --rm \
84+
-v $(pwd):/robot \
85+
-e CMD=jmeter \
86+
malovec/robot-runner:latest \
87+
-Jthreads=10 -Jduration=300 -n -t load_test.jmx -l results.jtl
88+
```
89+
90+
### 4. Run Custom Python Scripts
7691

77-
# Production stage
78-
FROM malovec/robot-runner:latest
79-
COPY --from=dev /opt/venv /opt/venv
92+
```bash
93+
docker run --rm \
94+
-v $(pwd):/robot \
95+
-e CMD=python \
96+
malovec/robot-runner:latest \
97+
my_script.py
8098
```
8199

82-
### CI/CD Pipeline Integration
83-
The image works seamlessly with GitHub Actions, GitLab CI, Jenkins, and other CI/CD platforms. See our [GitHub Actions workflow](#github-actions) example below.
100+
## πŸ”§ Advanced Configuration
101+
102+
### Volume Mounts for Data Persistence
84103

85-
## Architecture Support
104+
```bash
105+
# Mount current directory and specific output directory
106+
docker run --rm \
107+
-v $(pwd)/tests:/robot/tests \
108+
-v $(pwd)/results:/robot/results \
109+
malovec/robot-runner:latest \
110+
--outputdir /robot/results /robot/tests
111+
```
86112

87-
This image supports both modern architectures:
88-
- **linux/amd64**: Traditional 64-bit Intel/AMD processors
89-
- **linux/arm64**: Apple Silicon (M1/M2/M3) and ARM64 servers
113+
### Environment Variable Configuration
90114

91-
## GitHub Actions
115+
```bash
116+
docker run --rm \
117+
-v $(pwd):/robot \
118+
-e PYTHONPATH=/robot/lib \
119+
-e ROBOT_OPTIONS="--loglevel DEBUG" \
120+
malovec/robot-runner:latest
121+
```
92122

93-
This repository includes a ready-to-use GitHub Actions workflow for building and testing multi-architecture images:
123+
### Docker Compose Integration
94124

95125
```yaml
96-
# See publish.yml for complete workflow
97-
- name: Build multi-arch image
98-
uses: docker/build-push-action@v6
99-
with:
100-
platforms: linux/amd64,linux/arm64
101-
tags: malovec/robot-runner:latest,malovec/robot-runner:3.0
126+
version: '3.8'
127+
services:
128+
robot-tests:
129+
image: malovec/robot-runner:latest
130+
volumes:
131+
- ./tests:/robot/tests
132+
- ./results:/robot/results
133+
command: --outputdir /robot/results /robot/tests/smoke.robot
134+
```
135+
136+
## πŸ—οΈ Building from Source
137+
138+
### Build for Multiple Architectures
139+
140+
```bash
141+
# Build for both x64 and ARM
142+
docker buildx build --platform linux/amd64,linux/arm64 \
143+
-t malovec/robot-runner:latest \
144+
--push .
102145
```
103146

147+
### Custom Python Version
148+
149+
```bash
150+
# Build with specific Python version
151+
docker build --build-arg DHI_PYTHON_BUILD_TAG=3.11-alpine3.22-dev \
152+
-t my-robot-runner:custom .
153+
```
154+
155+
## πŸ”’ Security Features
156+
157+
- Built on Docker's hardened Python base image
158+
- Non-root user execution support
159+
- Minimal Alpine Linux base for reduced attack surface
160+
- Regular security updates from upstream bases
161+
- Python bytecode writing disabled (`PYTHONDONTWRITEBYTECODE=1`)
162+
163+
## πŸ“‹ Requirements File Structure
164+
165+
The image uses a structured approach for dependencies:
166+
167+
```
168+
requirements/
169+
β”œβ”€β”€ apk.in # Alpine Linux packages
170+
β”œβ”€β”€ npm.in # Node.js packages
171+
└── python.in # Python packages
172+
```
173+
174+
## πŸ“„ License
175+
176+
This project is open source. Please check the respective licenses for included tools:
177+
- Robot Framework: Apache License 2.0
178+
- Apache JMeter: Apache License 2.0
179+
- Python: Python Software Foundation License
180+
181+
## πŸ”— Links
182+
183+
- **Docker Hub**: [malovec/robot-runner](https://hub.docker.com/r/malovec/robot-runner)
184+
- **Robot Framework**: [robotframework.org](https://robotframework.org/)
185+
- **Apache JMeter**: [jmeter.apache.org](https://jmeter.apache.org/)
186+
187+
---
188+
189+
**Note**: This image is optimized for CI/CD pipelines and automated testing environments. For development purposes, consider using the interactive shell mode for debugging and exploration.
104190
---
105191
*Built with ❀️ for the Robot Framework community*

0 commit comments

Comments
Β (0)