Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/publish-ghcr.yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Push to GHCR

on:
push:
branches: [master]

jobs:
build-andpush:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Generate image tag
id: vars
run: echo "tag=$(awk -F'"' '/^version/{ print $2; exit; }' Cargo.toml)" >> $GITHUB_OUTPUT

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: |
ghcr.io/${{ secrets.GHCR_USERNAME }}/grin:latest
ghcr.io/${{ secrets.GHCR_USERNAME }}/grin:${{ steps.vars.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Builder
FROM rust:slim-trixie AS builder

WORKDIR /usr/src/grin
COPY . .

RUN apt update && \
apt install -y libncurses5-dev libncursesw5-dev

RUN cargo build --release

# Runner
FROM debian:trixie-slim
COPY --from=builder /usr/src/grin/target/release/grin /usr/local/bin/grin

RUN apt update && \
apt install -y libncursesw5-dev

# Create mainnet config
WORKDIR /root/.grin/main
RUN grin server config
RUN sed -i '/^run_tui /s/=.*$/= true/' grin-server.toml

# Create testnet config
WORKDIR /root/.grin/test
RUN grin --testnet server config
RUN sed -i '/^run_tui /s/=.*$/= true/' grin-server.toml

# Mainnet ports
EXPOSE 3413 3414

# Testnet ports
EXPOSE 13413 13414

# Stratum port
EXPOSE 3416

WORKDIR /root/.grin
ENTRYPOINT ["grin"]
CMD ["server", "run"]
4 changes: 1 addition & 3 deletions doc/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ grin client --help
## Docker

```sh
docker build -t grin -f etc/Dockerfile .
docker build -t grin .
```
For testnet, use `etc/Dockerfile.testnet` instead

You can bind-mount your grin cache to run inside the container.

```sh
Expand Down
2 changes: 1 addition & 1 deletion doc/translations/build_ES.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ grin client --help
## Docker

```sh
docker build -t grin -f etc/Dockerfile .
docker build -t grin .
```

Puede ubicar la caché de Grin para que se ejecute dentro del contenedor
Expand Down
4 changes: 1 addition & 3 deletions doc/translations/build_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,8 @@ grin client --help
## Docker

```sh
docker build -t grin -f etc/Dockerfile .
docker build -t grin .
```
testnetを使用する場合、代わりに`etc/Dockerfile.testnet`を指定。

コンテナ内で実行する場合、grinのキャッシュをバインドマウントすることも可能。

```sh
Expand Down
4 changes: 1 addition & 3 deletions doc/translations/build_KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,8 @@ grin client --help
## Docker 사용하기

```sh
docker build -t grin -f etc/Dockerfile .
docker build -t grin .
```

testnet을 사용하려면 `etc/Dockerfile.testnet` 을 사용하세요.
container 안에서 grin cache를 bind-mount로 사용 할 수 있습니다.

```sh
Expand Down
4 changes: 1 addition & 3 deletions doc/translations/build_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ grin client --help
## Docker

```sh
docker build -t grin -f etc/Dockerfile .
docker build -t grin .
```
对于 testnet, 使用 `etc/Dockerfile.testnet` 代替

您可以绑定安装您的 grin 缓存以在容器中运行。

```sh
Expand Down
49 changes: 0 additions & 49 deletions etc/Dockerfile

This file was deleted.

49 changes: 0 additions & 49 deletions etc/Dockerfile.testnet

This file was deleted.