Skip to content

Commit 15b7462

Browse files
committed
make circup available in Docker
1 parent 0101feb commit 15b7462

File tree

6 files changed

+31
-6
lines changed

6 files changed

+31
-6
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ pip install -e .
5353
### Using Docker
5454

5555
```bash
56-
# Build the Docker image
56+
# Build the Docker image (includes circup for dependency management)
5757
docker build -f docker/Dockerfile -t circremote:latest .
5858

5959
# Run circremote in a container
6060
docker-compose -f docker/docker-compose.yml run circremote-run /dev/ttyUSB0 BME280
6161

62+
# Test circup installation
63+
docker run --rm circremote:latest circup --version
64+
6265
# For more Docker options, see [docker/README.md](docker/README.md)
6366
```
6467

docker/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ WORKDIR /app
2121
# Copy the circremote source code
2222
COPY . .
2323

24+
# Install circup for CircuitPython dependency management
25+
RUN pip install circup
26+
2427
# Install circremote in development mode
2528
RUN pip install -e .
2629

docker/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,8 @@ list-cmd:
9191

9292
.PHONY: version
9393
version:
94-
make exec CMD="--version"
94+
make exec CMD="--version"
95+
96+
.PHONY: test-circup
97+
test-circup:
98+
docker run --rm circremote:latest circup --version

docker/README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ The Docker setup mounts several important directories:
4646
- Current directory for accessing local commands and files
4747
- `/dev/bus/usb``/dev/bus/usb` (read-only)
4848
- USB device access for Linux systems
49+
- `~/.cache/circup``/home/circremote/.cache/circup` (read-write)
50+
- circup cache for faster dependency installation
4951

5052
## Device Access
5153

@@ -54,6 +56,14 @@ The container has access to common serial devices:
5456
- `/dev/ttyACM0`
5557
- `/dev/ttyACM1`
5658

59+
## Dependencies
60+
61+
The Docker image includes:
62+
- **circup**: CircuitPython dependency management tool
63+
- Automatically installed and available for circremote to use
64+
- Cache is persisted via volume mount for faster installations
65+
- Can be configured via circremote's `-u` option or config file
66+
5767
## Usage Examples
5868

5969
### Basic Usage
@@ -81,9 +91,12 @@ docker-compose -f docker/docker-compose.yml run circremote-run \
8191
docker-compose -f docker/docker-compose.yml run circremote-run \
8292
-c /dev/ttyUSB0 BME280
8393

84-
# Use custom circup path
94+
# Use custom circup path (circup is installed in the container)
8595
docker-compose -f docker/docker-compose.yml run circremote-run \
8696
-u /usr/local/bin/circup /dev/ttyUSB0 BME280
97+
98+
# Test circup installation
99+
docker run --rm circremote:latest circup --version
87100
```
88101

89102
### WebSocket Connections

docker/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
- ~/.circremote:/home/circremote/.circremote:ro
1818
- .:/workspace:rw
1919
- /dev/bus/usb:/dev/bus/usb:ro
20+
- ~/.cache/circup:/home/circremote/.cache/circup:rw
2021
working_dir: /workspace
2122
stdin_open: true
2223
tty: true
@@ -41,6 +42,7 @@ services:
4142
- ~/.circremote:/home/circremote/.circremote:ro
4243
- .:/workspace:rw
4344
- /dev/bus/usb:/dev/bus/usb:ro
45+
- ~/.cache/circup:/home/circremote/.cache/circup:rw
4446
working_dir: /workspace
4547
network_mode: host
4648
# This service is meant to be run with specific commands

docker/validate.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ fi
2828
# Validate Dockerfile syntax (if docker is available)
2929
if command -v docker &> /dev/null; then
3030
echo "🔍 Validating Dockerfile syntax..."
31-
if docker build --dry-run -f Dockerfile .. > /dev/null 2>&1; then
32-
echo "Dockerfile syntax is valid"
31+
if docker build --help > /dev/null 2>&1; then
32+
echo "Docker is available and working"
3333
else
34-
echo "Dockerfile syntax validation failed"
34+
echo "Docker is available but not working properly"
3535
exit 1
3636
fi
3737
else

0 commit comments

Comments
 (0)