-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): Dockerize trusted-sync (#299)
* feat: dockerize trusted-sync fix: tag image chore: move dockerfiles to example dir clean up dockerfile fix: dockerfile * feat: docker publish github action * feat: docker publish github action
- Loading branch information
Showing
5 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Release and version | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
name: Publish Trusted Sync | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.PERSONAL_DOCKERHUB_ACCESS_TOKEN_USERNAME }} | ||
password: ${{ secrets.PERSONAL_DOCKERHUB_ACCESS_TOKEN_SECRET }} | ||
- name: Build and Push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: examples/trusted-sync/Dockerfile | ||
push: true | ||
tags: refcell/trusted-sync:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
|
||
# Rust target | ||
target/ | ||
|
||
# Environment Variables | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM rust:latest as build | ||
|
||
RUN rustup target add x86_64-unknown-linux-musl | ||
RUN apt-get update && apt-get install -y musl-tools | ||
|
||
COPY ./crates/ /kona/crates | ||
COPY ./bin/ /kona/bin | ||
COPY ./examples/ /kona/examples | ||
COPY ./Cargo.toml /kona | ||
COPY ./Cargo.lock /kona | ||
COPY ./rustfmt.toml /kona | ||
COPY ./README.md /kona | ||
WORKDIR /kona | ||
|
||
RUN cargo build --release --config net.git-fetch-with-cli=true -p trusted-sync | ||
RUN cp /kona/target/release/trusted-sync /usr/local/bin/trusted-sync | ||
RUN chmod +x ./examples/trusted-sync/run.sh | ||
|
||
CMD ["./examples/trusted-sync/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/bash | ||
|
||
/usr/local/bin/trusted-sync \ | ||
--l1-rpc-url $L1_RPC_URL \ | ||
--l2-rpc-url $L2_RPC_URL \ | ||
--beacon-url $BEACON_URL \ | ||
--start-l2-block $START_L2_BLOCK \ | ||
--metrics-server-addr $METRICS_SERVER_ADDR \ | ||
--metrics-server-port $METRICS_SERVER_PORT \ | ||
-vvv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters