Skip to content

Commit dbd648e

Browse files
committed
add image building action for proxy
1 parent a7543d4 commit dbd648e

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

.github/workflows/docker.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,49 @@ jobs:
360360
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
361361
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
362362
363+
coordinator-proxy:
364+
runs-on:
365+
group: scroll-reth-runner-group
366+
steps:
367+
- name: Checkout code
368+
uses: actions/checkout@v4
369+
- name: Set up QEMU
370+
uses: docker/setup-qemu-action@v2
371+
- name: Set up Docker Buildx
372+
uses: docker/setup-buildx-action@v2
373+
- name: Login to Docker Hub
374+
uses: docker/login-action@v2
375+
with:
376+
username: ${{ secrets.DOCKERHUB_USERNAME }}
377+
password: ${{ secrets.DOCKERHUB_TOKEN }}
378+
- name: Configure AWS credentials
379+
uses: aws-actions/configure-aws-credentials@v4
380+
with:
381+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
382+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
383+
aws-region: ${{ env.AWS_REGION }}
384+
- name: Login to Amazon ECR
385+
id: login-ecr
386+
uses: aws-actions/amazon-ecr-login@v2
387+
- name: check repo and create it if not exist
388+
env:
389+
REPOSITORY: coordinator-proxy
390+
run: |
391+
aws --region ${{ env.AWS_REGION }} ecr describe-repositories --repository-names ${{ env.REPOSITORY }} && : || aws --region ${{ env.AWS_REGION }} ecr create-repository --repository-name ${{ env.REPOSITORY }}
392+
- name: Build and push
393+
uses: docker/build-push-action@v3
394+
env:
395+
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
396+
REPOSITORY: coordinator-proxy
397+
IMAGE_TAG: ${{ github.ref_name }}
398+
with:
399+
context: .
400+
file: ./build/dockerfiles/coordinator-proxy.Dockerfile
401+
push: true
402+
tags: |
403+
scrolltech/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
404+
${{ env.ECR_REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}
405+
363406
coordinator-cron:
364407
runs-on:
365408
group: scroll-reth-runner-group
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Download Go dependencies
2+
FROM scrolltech/go-rust-builder:go-1.22.12-rust-nightly-2025-02-14 as base
3+
WORKDIR /src
4+
COPY go.work* ./
5+
COPY ./rollup/go.* ./rollup/
6+
COPY ./common/go.* ./common/
7+
COPY ./coordinator/go.* ./coordinator/
8+
COPY ./database/go.* ./database/
9+
COPY ./tests/integration-test/go.* ./tests/integration-test/
10+
COPY ./bridge-history-api/go.* ./bridge-history-api/
11+
RUN go mod download -x
12+
13+
14+
# Build coordinator proxy
15+
FROM base as builder
16+
COPY . .
17+
RUN cd ./coordinator && CGO_LDFLAGS="-Wl,--no-as-needed -ldl" make coordinator_proxy && mv ./build/bin/coordinator_proxy /bin/coordinator_proxy
18+
19+
# Pull coordinator proxy into a second stage deploy ubuntu container
20+
FROM ubuntu:20.04
21+
ENV CGO_LDFLAGS="-Wl,--no-as-needed -ldl"
22+
RUN apt update && apt install vim netcat-openbsd net-tools curl jq -y
23+
COPY --from=builder /bin/coordinator_proxy /bin/
24+
RUN /bin/coordinator_proxy --version
25+
WORKDIR /app
26+
ENTRYPOINT ["/bin/coordinator_proxy"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
assets/
2+
contracts/
3+
docs/
4+
l2geth/
5+
rpc-gateway/
6+
*target/*
7+
8+
permissionless-batches/conf/

0 commit comments

Comments
 (0)