Skip to content

Commit 8f5ef3f

Browse files
authored
Merge pull request #2 from heliaxdev/docker-image
docker
1 parent 16e68be commit 8f5ef3f

File tree

4 files changed

+92
-0
lines changed

4 files changed

+92
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
namada/parse/target
2+
migrate-masp-events
3+
Dockerfile

.github/workflows/docker.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Docker 🐳
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'v*'
8+
tags:
9+
- 'v*'
10+
pull_request:
11+
branches:
12+
- main
13+
14+
permissions:
15+
id-token: write
16+
contents: write
17+
packages: write
18+
19+
jobs:
20+
docker:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Docker meta
25+
id: meta
26+
uses: docker/metadata-action@v5
27+
with:
28+
images: ghcr.io/${{ github.repository_owner }}/migrate-masp-events
29+
github-token: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Login to GHCR
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.repository_owner }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v3
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
- name: Build and push
41+
uses: docker/build-push-action@v6
42+
with:
43+
context: .
44+
file: Dockerfile
45+
push: ${{ github.event_name == 'push' }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
tags: ${{ steps.meta.outputs.tags }}
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM rust:1.85-slim as rust-build
2+
3+
WORKDIR /app
4+
5+
RUN apt-get update && apt-get install -y \
6+
build-essential \
7+
clang-tools-14 \
8+
git \
9+
libssl-dev \
10+
pkg-config \
11+
protobuf-compiler \
12+
libudev-dev \
13+
&& apt-get clean
14+
15+
COPY namada/parse ./
16+
17+
RUN cargo build --release
18+
19+
FROM golang:1.24 AS go-build
20+
21+
WORKDIR /app
22+
23+
COPY --from=rust-build /app/target/release namada/parse/target/release
24+
25+
COPY go.mod go.sum ./
26+
RUN go mod download
27+
28+
COPY . .
29+
30+
RUN CGO_ENABLED=1 CGO_LDFLAGS=-lm go build
31+
32+
FROM debian:bookworm-slim
33+
34+
COPY --from=go-build /app/migrate-masp-events /app/migrate-masp-events
35+
36+
WORKDIR /app
37+
38+
ENTRYPOINT ["/app/migrate-masp-events"]

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "1.85.1"

0 commit comments

Comments
 (0)