Skip to content

Commit 5ebf3b1

Browse files
authored
Merge pull request #131 from Ac3sRwild/Ac3sRwild-docker_support
Ac3s rwild docker support
2 parents 2c18fff + 27a8274 commit 5ebf3b1

File tree

3 files changed

+93
-5
lines changed

3 files changed

+93
-5
lines changed

.github/workflows/docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ jobs:
4646
latest=${{ matrix.latest-tag-behaviour }}
4747
suffix=${{ matrix.version-suffix }}
4848
tags: |
49-
type=semver,pattern={{version}}
50-
type=semver,pattern={{major}}.{{minor}}
51-
type=semver,pattern={{major}}
49+
type=match,pattern=\d+.\d+.\d+.*
50+
type=match,pattern=\d+.\d+
51+
type=match,pattern=\d+
5252
5353
- name: Set up Docker Buildx
5454
uses: docker/setup-buildx-action@v2

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ RUN apt-get update && apt-get -y upgrade \
1212
WORKDIR /app
1313
COPY docker-start.sh .
1414
ARG GIT_RELEASE
15-
ARG GIT_RELEASE_URL=https://github.com/madMAx43v3r/chia-gigahorse/releases/download/v${GIT_RELEASE}/chia-gigahorse-farmer-${GIT_RELEASE}-x86_64.tar.gz
16-
RUN curl -L ${GIT_RELEASE_URL} --output chia-gigahorse-farmer.tar.gz \
15+
RUN GIT_RELEASE=${GIT_RELEASE%-*} \
16+
&& curl -L https://github.com/madMAx43v3r/chia-gigahorse/releases/download/v${GIT_RELEASE}/chia-gigahorse-farmer-${GIT_RELEASE}-x86_64.tar.gz --output chia-gigahorse-farmer.tar.gz \
1717
&& tar -xf chia-gigahorse-farmer.tar.gz \
1818
&& cp -r chia-gigahorse-farmer/* . \
1919
&& rm -rf chia-gigahorse-farmer \

README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,91 @@ Plot Sink is a tool to receive plots over the network and copy them to multiple
205205
You can find binaries in [plot-sink](https://github.com/madMAx43v3r/chia-gigahorse/tree/master/plot-sink)
206206

207207
See also the open source repository: https://github.com/madMAx43v3r/chia-plot-sink
208+
209+
## Docker Usage
210+
211+
The Dockerfile file uses multiple build stages to support 3 different applications CPU-Only, AMD-GPU, NVIDIA-GPU.
212+
213+
Each image provides a volume for `/data` which you can override with your own volume or a mapped path to customize the storage location of the node data.
214+
215+
The default behavior of the container is to look in `/data` for an existing db/config and use it. Otherwise it will generate a fresh config and start syncing the node from scratch.
216+
217+
You can set which services to run with the `CHIA_SERVICES` environment variable.
218+
219+
Docker Run Examples:
220+
```
221+
-e CHIA_SERVICES="harvester"
222+
-e CHIA_SERVICES="node farmer-only"
223+
-e CHIA_SERVICES="node farmer-only wallet"
224+
```
225+
Docker Compose Examples:
226+
```yml
227+
environment:
228+
- CHIA_SERVICES="harvester"
229+
230+
environment:
231+
- CHIA_SERVICES="node farmer-only"
232+
233+
environment:
234+
- CHIA_SERVICES="node farmer-only wallet"
235+
```
236+
237+
### CPU-Only
238+
239+
Docker Run Example:
240+
241+
`docker run --rm -it -v /path/to/.chia:/data chia-gigahorse`
242+
243+
Docker Compose Example:
244+
```yml
245+
version: '3'
246+
services:
247+
node:
248+
image: chia-gigahorse
249+
restart: unless-stopped
250+
volumes:
251+
- /path/to/.chia:/data
252+
```
253+
254+
### AMD-GPU
255+
256+
Docker Run Example:
257+
258+
`docker run --rm -it --device=/dev/kfd --device=/dev/dri --group-add video --group-add render -v /path/to/.chia:/data chia-gigahorse-amd`
259+
260+
Docker Compose Example:
261+
```yml
262+
version: '3'
263+
services:
264+
node:
265+
image: chia-gigahorse-amd
266+
restart: unless-stopped
267+
group_add:
268+
- video
269+
- render
270+
devices:
271+
- /dev/dri:/dev/dri
272+
- /dev/kfd:/dev/kfd
273+
volumes:
274+
- /path/to/.chia:/data
275+
```
276+
Note: `- render` in `group_add` might need to be removed, depending on your system.
277+
278+
### NVIDIA-GPU
279+
280+
Docker Run Example:
281+
282+
`docker run --rm -it --runtime=nvidia -v /path/to/.chia:/data chia-gigahorse-nvidia`
283+
284+
Docker Compose Example:
285+
```yml
286+
version: '3'
287+
services:
288+
node:
289+
image: chia-gigahorse-nvidia
290+
restart: unless-stopped
291+
runtime: nvidia
292+
volumes:
293+
- /path/to/.chia:/data
294+
```
295+
Note: for nvidia you also need the `NVIDIA Container Toolkit` installed on the host, for more info please see: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker

0 commit comments

Comments
 (0)