Using RDEToolKit with Docker
Overview
This guide explains how to run RDE structured processing using RDEToolKit on Docker. Using Docker ensures environment consistency and simplifies deployment.
Prerequisites
- Docker Desktop or Docker Engine installed
- Basic knowledge of Docker commands
- Understanding of RDEToolKit project structure
Directory Structure
Recommended directory structure for structured processing projects:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Creating Dockerfile
Create container/Dockerfile
. Here's a basic Dockerfile example:
container/Dockerfile | |
---|---|
1 2 3 4 5 6 7 8 9 10 |
|
Customization
Feel free to modify the Docker image and execution statements according to your project requirements.
Reference
You can find base images at Docker Hub Container Image Library.
Building Images
Basic Build
Navigate to the directory containing the Dockerfile
and run the docker build command:
Image Build | |
---|---|
1 2 3 4 5 |
|
Option Descriptions
-t
option: Specifies image name and tag. Image name can be arbitrary but should be unique.- Path: Specifies the path to the directory containing the
Dockerfile
. Use.
for current directory.
Proxy Environment Support
When building in a proxy environment, add the following options:
Build in Proxy Environment | |
---|---|
1 2 3 4 |
|
Handling pip Command Errors
Solution for SSL certificate errors with pip commands:
Creating pip.conf File
Create a pip.conf
file in the same directory as the Dockerfile:
pip.conf | |
---|---|
1 2 3 4 5 |
|
Modifying Dockerfile
Modify the Dockerfile to use pip.conf:
Modified Dockerfile | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
Running Docker Containers
Basic Execution
To run the built image, use the docker run
command:
Container Execution | |
---|---|
1 2 3 4 5 |
|
Option Details
Option | Description |
---|---|
-it |
Run container in interactive mode. Enables terminal and command-line interface |
-v host_path:container_path |
Mount directory between host and container |
--name "container_name" |
Assign a name to the container |
image_name:tag |
Name and version of Docker image to run |
"/bin/bash" |
Command to execute inside the container |
Mounting Data Volumes
Mount input file directories to test structured processing:
Data Mount Example | |
---|---|
1 2 3 4 5 6 |
|
Running Programs Inside Container
Once the container starts, execute your developed program:
Program Execution | |
---|---|
1 2 3 4 5 |
|
Terminal Change
When executed, the terminal will change to something like root@(container_id):
.
Container Management
Exiting Container
Exit Container | |
---|---|
1 |
|
Restarting Container
Restart Stopped Container | |
---|---|
1 2 |
|
Removing Container
Remove Container | |
---|---|
1 |
|
Best Practices
Multi-stage Build
For production environments, use multi-stage builds to optimize image size:
Multi-stage Dockerfile | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
.dockerignore File
Exclude unnecessary files from build context:
.dockerignore | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Troubleshooting
Common Issues and Solutions
- Port Conflict Error
- Avoid ports already in use
-
Check running containers with
docker ps
-
Volume Mount Error
- Verify paths are correct
-
Check permission settings
-
Out of Memory Error
- Check Docker memory limits
- Stop unnecessary containers
Next Steps
- Understand Structured Processing Concepts
- Learn Docker environment configuration in Configuration Files
- Check archive creation using artifact command in Command Line Interface