diff --git a/.github/workflows/l1-devnet-release.yaml b/.github/workflows/l1-devnet-release.yaml new file mode 100644 index 00000000..9d70ca3d --- /dev/null +++ b/.github/workflows/l1-devnet-release.yaml @@ -0,0 +1,47 @@ +name: Build and publish docker image + +on: + push: + tags: + - 'l1-devnet-*' +jobs: + build: + name: Clone, Build, Publish + runs-on: ubuntu-latest + steps: + + - name: Check out repository + uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Dockerhub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract tag version + id: extract_tag + run: | + # Extract the tag version part from the ref name + VERSION=$(echo "${GITHUB_REF##*/}" | sed 's/^l1-devnet-//') + echo "VERSION=${VERSION}" >> $GITHUB_ENV + + - name: Build image + id: build + env: + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: l1-devnet + uses: docker/build-push-action@v3 + with: + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOSITORY }}:${{ env.VERSION }} + ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPOSITORY }}:latest + diff --git a/custom-images/l1-devnet/Dockerfile b/custom-images/l1-devnet/Dockerfile new file mode 100644 index 00000000..7890b8a8 --- /dev/null +++ b/custom-images/l1-devnet/Dockerfile @@ -0,0 +1,27 @@ +# Use the latest Alpine base image +FROM debian:12-slim + +# Install dependencies +RUN apt update +RUN apt install --yes curl bash coreutils git + +# Switch to bash shell +SHELL ["/bin/bash", "-c"] + +# Download and run the Foundry installation script +RUN curl -L https://foundry.paradigm.xyz | bash + +# Set the environment variables to ensure Foundry tools are in the PATH +ENV PATH="/root/.foundry/bin:${PATH}" + +# Run foundryup to update Foundry +RUN foundryup + +# Expose the port Anvil uses (default: 8545) +EXPOSE 8545 + +# Set default value for CHAIN_ID if not provided +ENV CHAIN_ID=111111 + +# Command to run Anvil with the specified host, port, and chain ID +CMD ["bash", "-c", "anvil --host 0.0.0.0 --port 8545 --chain-id ${CHAIN_ID}"] \ No newline at end of file