├── .gitattributes ├── .github └── workflows │ └── docker-image.yml ├── Dockerfile ├── README.md ├── docker-start.sh ├── dockercompose.yml └── libducohash.tar.gz /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | env: 11 | DOCKER_PLATFORMS: linux/amd64,linux/arm64 12 | 13 | steps: 14 | - name: Checkout 15 | uses: actions/checkout@v3 16 | - name: Set up QEMU 17 | uses: docker/setup-qemu-action@v2.1.0 18 | - name: setup docker buildx 19 | uses: docker/setup-buildx-action@v2 20 | id: buildx 21 | with: 22 | install: true 23 | 24 | - name: Login to DockerHub 25 | uses: docker/login-action@v2 26 | with: 27 | username: ${{ secrets.DOCKER_USERNAME }} 28 | password: ${{ secrets.DOCKER_PASSWORD }} 29 | 30 | - name: Login to GitHub Container Registry 31 | uses: docker/login-action@v2 32 | with: 33 | registry: ghcr.io 34 | username: ${{ github.actor }} 35 | password: ${{ secrets.PAT_TOKEN }} 36 | 37 | - name: Build and push 38 | uses: docker/build-push-action@v5 39 | with: 40 | context: . 41 | push: true 42 | sbom: true 43 | provenance: mode=max 44 | outputs: type=registry 45 | platforms: | 46 | linux/amd64 47 | linux/arm64 48 | file: Dockerfile 49 | tags: ${{ secrets.DOCKER_USERNAME }}/duinocoin:latest, ghcr.io/${{ secrets.DOCKER_USERNAME }}/duinocoin:latest 50 | github-token: ${{ secrets.PAT_TOKEN }} 51 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # Stage 1: Build the application 2 | FROM python:3 AS builder 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | ENV container docker 6 | ENV TERM=xterm 7 | 8 | WORKDIR /app/ 9 | 10 | # Install system dependencies 11 | RUN apt-get update && apt full-upgrade -y && apt-get install -y --no-install-recommends \ 12 | curl \ 13 | python3-pip \ 14 | python3-dev \ 15 | wget \ 16 | build-essential \ 17 | git && \ 18 | rm -rf /var/lib/apt/lists/* 19 | 20 | RUN git clone https://github.com/revoxhere/duino-coin.git 21 | 22 | # Install rustup for compilation 23 | RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y 24 | ENV PATH="/root/.cargo/bin:${PATH}" 25 | 26 | # Download duino fasthash 27 | COPY libducohash.tar.gz ./libducohash.tar.gz 28 | RUN wget https://server.duinocoin.com/fasthash/libducohash.tar.gz || true 29 | 30 | # Unpack it 31 | RUN tar -xvf libducohash.tar.gz 32 | 33 | # Go to the dir 34 | WORKDIR /app/libducohash 35 | 36 | # #Compile it 37 | # RUN rustup install stable && rustup default stable 38 | # RUN cargo build --release 39 | 40 | # #Extract the module and move it to /app/duino-coin 41 | # RUN mv target/release/libducohasher.so /app/duino-coin/libducohasher.so 42 | 43 | WORKDIR /app/ 44 | 45 | RUN rm -R libducohash.tar.gz && rm -R libducohash 46 | 47 | COPY ./docker-start.sh ./duino-coin/docker-start.sh 48 | 49 | # Stage 2: Create the final lightweight image 50 | FROM python:3 51 | 52 | LABEL org.opencontainers.image.source="https://github.com/simeononsecurity/docker-duino-coin/" 53 | LABEL org.opencontainers.image.description="Dockerized Duino-Coin Miner" 54 | LABEL org.opencontainers.image.authors="revoxhere,simeononsecurity" 55 | 56 | ENV DEBIAN_FRONTEND noninteractive 57 | ENV container docker 58 | ENV TERM=xterm 59 | 60 | WORKDIR /app 61 | 62 | COPY --from=builder /app /app 63 | 64 | # Change to the cloned directory 65 | WORKDIR /app/duino-coin 66 | 67 | ENV DUCO_USERNAME="simeononsecurity" \ 68 | DUCO_MINING_KEY="simeononsecurity" \ 69 | DUCO_INTENSITY=50 \ 70 | DUCO_THREADS=2 \ 71 | DUCO_START_DIFF="MEDIUM" \ 72 | DUCO_DONATE=0 \ 73 | DUCO_IDENTIFIER="Auto" \ 74 | DUCO_ALGORITHM="DUCO-S1" \ 75 | DUCO_LANGUAGE="english" \ 76 | DUCO_SOC_TIMEOUT=20 \ 77 | DUCO_REPORT_SEC=300 \ 78 | DUCO_RASPI_LEDS="n" \ 79 | DUCO_RASPI_CPU_IOT="n" \ 80 | DUCO_DISCORD_RP="n" 81 | 82 | # Install system dependencies 83 | RUN apt-get update && apt-get install -y --no-install-recommends\ 84 | curl \ 85 | python3-pip \ 86 | python3-dev \ 87 | wget \ 88 | git \ 89 | build-essential \ 90 | && \ 91 | rm -rf /var/lib/apt/lists/* 92 | 93 | # Install pip dependencies 94 | RUN python3 -m pip install --no-cache-dir --upgrade pip && \ 95 | python3 -m pip install --no-cache-dir -r requirements.txt 96 | 97 | # Make script executable 98 | RUN chmod +x /app/duino-coin/docker-start.sh 99 | 100 | # Specify the command to run on container start 101 | CMD ["/app/duino-coin/docker-start.sh"] 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dockerized Duino-Coin Miner 2 | 3 | This repository contains a Dockerized version of the Duino-Coin Miner. 4 | 5 | [![Sponsor](https://img.shields.io/badge/Sponsor-Click%20Here-ff69b4)](https://github.com/sponsors/simeononsecurity) [![Docker Image CI](https://github.com/simeononsecurity/docker-duino-coin/actions/workflows/docker-image.yml/badge.svg)](https://github.com/simeononsecurity/docker-duino-coin/actions/workflows/docker-image.yml)[![Docker Hub Image simeononsecurity/duinocoin](https://img.shields.io/badge/DockerHub-Image-blue)](https://hub.docker.com/r/simeononsecurity/duinocoin)[![simeononsecurity.com website](https://img.shields.io/badge/SimeonOnSecurity-Website-Gray)](https://simeononsecurity.com) 6 | ## Docker Container 7 | 8 | ### Build or Pull the Docker Image 9 | 10 | #### Build 11 | 12 | ```bash 13 | git clone https://github.com/simeononsecurity/docker-duino-coin.git 14 | cd duino-coin 15 | docker build -t duinocoin . 16 | ``` 17 | 18 | #### Pull 19 | ``` 20 | docker pull simeononsecurity/duinocoin 21 | ``` 22 | 23 | ### Run the Docker Container with Docker Run 24 | 25 | ```bash 26 | docker run -td --name duco-container --restart unless-stopped \ 27 | -e DUCO_USERNAME="your_actual_username_or_walletname" \ 28 | -e DUCO_MINING_KEY="your_actual_mining_key" \ 29 | duinocoin 30 | ``` 31 | 32 | #### Docker Run Example with Configurable Options 33 | 34 | ```bash 35 | # Build the Docker Image 36 | docker build -t duinocoin . 37 | 38 | # Run the Docker Container with Custom Configuration 39 | docker run -td --name duco-container --restart unless-stopped \ 40 | -e DUCO_USERNAME="your_actual_username_or_walletname" \ 41 | -e DUCO_MINING_KEY="your_actual_mining_key" \ 42 | -e DUCO_INTENSITY=50 \ 43 | -e DUCO_THREADS=2 \ 44 | -e DUCO_START_DIFF="MEDIUM" \ 45 | -e DUCO_DONATE=1 \ 46 | -e DUCO_IDENTIFIER="Auto" \ 47 | -e DUCO_ALGORITHM="DUCO-S1" \ 48 | -e DUCO_LANGUAGE="english" \ 49 | -e DUCO_SOC_TIMEOUT=20 \ 50 | -e DUCO_REPORT_SEC=300 \ 51 | -e DUCO_RASPI_LEDS="n" \ 52 | -e DUCO_RASPI_CPU_IOT="n" \ 53 | -e DUCO_DISCORD_RP="n" \ 54 | duinocoin 55 | ``` 56 | ### Run the Docker Container with Docker Compose 57 | 58 | #### Create the docker compose file 59 | ```nano docker-compose.yml``` 60 | 61 | #### Copy and past into the docker-compose.yaml file in your editor 62 | ```dockerfile 63 | version: '3' 64 | services: 65 | duco-container: 66 | image: simeononsecurity/duinocoin:latest 67 | container_name: duco-container 68 | restart: unless-stopped 69 | environment: 70 | - DUCO_USERNAME=your_actual_username_or_walletname 71 | - DUCO_MINING_KEY=your_actual_mining_key 72 | - DUCO_INTENSITY=50 73 | - DUCO_THREADS=2 74 | - DUCO_START_DIFF=MEDIUM 75 | - DUCO_DONATE=1 76 | - DUCO_IDENTIFIER=Auto 77 | - DUCO_ALGORITHM=DUCO-S1 78 | - DUCO_LANGUAGE=english # Adjusted the language key if needed 79 | - DUCO_SOC_TIMEOUT=20 80 | - DUCO_REPORT_SEC=300 81 | - DUCO_RASPI_LEDS=n 82 | - DUCO_RASPI_CPU_IOT=n 83 | - DUCO_DISCORD_RP=n 84 | ``` 85 | 86 | ##### Run the file 87 | ```bash 88 | docker-compose up -d 89 | ``` 90 | 91 | Feel free to adjust the environment variables as needed for your mining preferences. The example includes some commonly used options, and you can refer to the [Duino-Coin README](https://github.com/revoxhere/duino-coin) for more details on available configurations. 92 | 93 | If you have any questions or need further assistance, don't hesitate to reach out! 94 | -------------------------------------------------------------------------------- /docker-start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Set the base path 4 | base_path="/app/duino-coin" 5 | 6 | python_script="${base_path}/PC_Miner.py" 7 | 8 | chmod +x "${base_path}/PC_Miner.py" 9 | 10 | # Find the line containing "VER = x.x" in the Python script and extract the version number 11 | ver_value=$(grep -oP 'VER = \K\d+\.\d+' "$python_script") 12 | 13 | # Set the environment variable 14 | export VER="$ver_value" 15 | 16 | # Display the extracted value (optional) 17 | echo "Extracted PC Miner VER value: $VER" 18 | 19 | ## Create Expected Path 20 | mkdir "${base_path}/Duino-Coin PC Miner ${ver_value}" 21 | 22 | # Find the highest version number in the folder 23 | highest_version=$(ls -d "${base_path}/Duino-Coin PC Miner"* | grep -Eo 'Duino-Coin PC Miner [0-9.]+' | sort -Vr | head -n 1) 24 | 25 | # Construct the full path with the highest version number 26 | full_path="${base_path}/${highest_version}" 27 | 28 | #Create Expected Config File 29 | touch "${full_path}/Miner_config.cfg" 30 | 31 | # Detect ARM architecture 32 | if [ "$(uname -m)" = "armv6l" ] || [ "$(uname -m)" = "armv7l" ] || [ "$(uname -m)" = "aarch64" ]; then 33 | DUCO_RASPI_CPU_IOT="y" 34 | else 35 | DUCO_RASPI_CPU_IOT="n" 36 | fi 37 | 38 | # Export for Dockerfile to pick up 39 | export DUCO_RASPI_CPU_IOT 40 | 41 | echo '[PC Miner]' > "${full_path}/Miner_config.cfg" 42 | echo "username = ${DUCO_USERNAME}" >> "${full_path}/Miner_config.cfg" 43 | echo "mining_key = $(echo -n ${DUCO_MINING_KEY} | base64)" >> "${full_path}/Miner_config.cfg" 44 | echo "intensity = ${DUCO_INTENSITY}" >> "${full_path}/Miner_config.cfg" 45 | echo "threads = ${DUCO_THREADS}" >> "${full_path}/Miner_config.cfg" 46 | echo "start_diff = ${DUCO_START_DIFF}" >> "${full_path}/Miner_config.cfg" 47 | echo "donate = ${DUCO_DONATE}" >> "${full_path}/Miner_config.cfg" 48 | echo "identifier = ${DUCO_IDENTIFIER}" >> "${full_path}/Miner_config.cfg" 49 | echo "algorithm = ${DUCO_ALGORITHM}" >> "${full_path}/Miner_config.cfg" 50 | echo "language = ${DUCO_LANGUAGE}" >> "${full_path}/Miner_config.cfg" 51 | echo "soc_timeout = ${DUCO_SOC_TIMEOUT}" >> "${full_path}/Miner_config.cfg" 52 | echo "report_sec = ${DUCO_REPORT_SEC}" >> "${full_path}/Miner_config.cfg" 53 | echo "raspi_leds = ${DUCO_RASPI_LEDS}" >> "${full_path}/Miner_config.cfg" 54 | echo "raspi_cpu_iot = ${DUCO_RASPI_CPU_IOT}" >> "${full_path}/Miner_config.cfg" 55 | echo "discord_rp = ${DUCO_DISCORD_RP}" >> "${full_path}/Miner_config.cfg" 56 | 57 | cp "${full_path}/Miner_config.cfg" "${full_path}/Settings.cfg" 58 | cp "${full_path}/Miner_config.cfg" "${base_path}/Settings.cfg" 59 | 60 | #Needed to start script 61 | wget -O "${full_path}/Translations.json" https://raw.githubusercontent.com/revoxhere/duino-coin/master/Resources/PC_Miner_langs.json 62 | wget -O "${full_path}/Donate.exe" https://server.duinocoin.com/donations/DonateExecutableWindows.exe 63 | 64 | python3 "${base_path}/PC_Miner.py" 65 | -------------------------------------------------------------------------------- /dockercompose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | duco-container: 4 | image: simeononsecurity/duinocoin 5 | container_name: duco-container 6 | restart: unless-stopped 7 | environment: 8 | - DUCO_USERNAME=your_actual_username_or_walletname 9 | - DUCO_MINING_KEY=your_actual_mining_key 10 | - DUCO_INTENSITY=50 11 | - DUCO_THREADS=2 12 | - DUCO_START_DIFF="MEDIUM" 13 | - DUCO_DONATE=1 14 | - DUCO_IDENTIFIER="Auto" 15 | - DUCO_ALGORITHM="DUCO-S1" 16 | - DUCO_LANGUAGE="english" 17 | - DUCO_SOC_TIMEOUT=20 18 | - DUCO_REPORT_SEC=300 19 | - DUCO_RASPI_LEDS="n" 20 | - DUCO_RASPI_CPU_IOT="n" 21 | - DUCO_DISCORD_RP="n" 22 | -------------------------------------------------------------------------------- /libducohash.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simeononsecurity/docker-duino-coin/6b9c32d2b83ebcd7d6735f9db0a0dc57d15659cf/libducohash.tar.gz --------------------------------------------------------------------------------