Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mabruzzo3169 committed Jan 16, 2025
0 parents commit ae3882e
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM debian:bullseye-slim

# Install PhotoRec and its dependencies
RUN apt-get update && \
apt-get install -y \
testdisk \
&& rm -rf /var/lib/apt/lists/*

# Create a directory for mounting external volumes
WORKDIR /data

# Run PhotoRec as the entrypoint
ENTRYPOINT ["photorec"]

# Default command (can be overridden)
CMD ["/data"]
48 changes: 48 additions & 0 deletions github-workflow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docker Build and Push

on:
push:
branches: [ "main" ]
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]

env:
REGISTRY: docker.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Empty file added notes
Empty file.
9 changes: 9 additions & 0 deletions project-structure.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
photorec-docker/
├── .github/
│ └── workflows/
│ └── docker-publish.yml
├── docs/
│ └── usage.md
├── Dockerfile
├── README.md
└── .dockerignore
56 changes: 56 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# PhotoRec Docker Container

A containerized version of PhotoRec data recovery tool, optimized for easy deployment and use in various environments including Unraid.

## Features

- Based on Debian Bullseye slim for minimal image size
- Includes latest stable PhotoRec/TestDisk
- Designed for easy mounting of devices and volumes
- Compatible with Unraid and other Docker environments

## Quick Start

```bash
# Pull the image
docker pull yourusername/photorec

# Run PhotoRec
docker run -it --privileged \
--device=/dev/sdX \
-v /path/to/output:/data \
yourusername/photorec
```

## Usage in Unraid

1. Go to the Docker tab in Unraid web interface
2. Click "Add Container"
3. Fill in the template:
- Repository: yourusername/photorec
- Name: photorec
- Network Type: Bridge
- Volumes:
- Host: /mnt/user/appdata/photorec
- Container: /data
- Extra Parameters: --privileged

## Building Locally

```bash
git clone https://github.com/yourusername/photorec-docker.git
cd photorec-docker
docker build -t yourusername/photorec .
```

## Security Note

This container requires privileged access to read from devices. Only run it with devices you trust and in environments where you understand the security implications.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

0 comments on commit ae3882e

Please sign in to comment.