Skip to content

Commit

Permalink
fix(docs): updated readme and fixed launcher (#298)
Browse files Browse the repository at this point in the history
Co-authored-by: Apoorv Sadana <[email protected]>
  • Loading branch information
antiyro and apoorvsadana authored Oct 2, 2024
1 parent 9724575 commit 6e69868
Show file tree
Hide file tree
Showing 5 changed files with 307 additions and 163 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
Expand All @@ -31,7 +25,6 @@ jobs:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: |
ghcr.io/${{ github.repository_owner }}/madara:latest
ghcr.io/${{ github.repository_owner }}/madara:${{ github.event.release.tag_name }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- fix(docs): updated readme and fixed launcher
- fix(ci): added gateway key to fix rate limit on tests
- feat(cli): launcher script and release workflows
- fix: cleaned cli settings for sequencer, devnet and full
Expand Down
58 changes: 23 additions & 35 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,48 @@
# Stage 1: Build the application
FROM rust:1.78 AS builder

# Install build dependencies
RUN apt-get -y update && \
RUN apt-get -y update && \
apt-get install -y clang && \
apt-get autoremove -y; \
apt-get clean; \
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /usr/src/madara/

# Copy the source code
# Copy the source code into the container
COPY Cargo.toml Cargo.lock ./
COPY crates crates
COPY cairo cairo
COPY cairo_0 cairo_0

# Installing Scarb
# Dynamically detect the architecture
ARG SCARB_VERSION="v2.8.2"
ARG SCARB_REPO="https://github.com/software-mansion/scarb/releases/download"
RUN ARCH=$(uname -m); \
if [ "$ARCH" = "x86_64" ]; then \
PLATFORM="x86_64-unknown-linux-gnu"; \
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
PLATFORM="aarch64-unknown-linux-gnu"; \
else \
echo "Unsupported architecture: $ARCH"; exit 1; \
fi && \
curl -fLS -o /usr/src/scarb.tar.gz \
$SCARB_REPO/$SCARB_VERSION/scarb-$SCARB_VERSION-$PLATFORM.tar.gz && \
tar -xz -C /usr/local --strip-components=1 -f /usr/src/scarb.tar.gz

# Installing scarb, new since devnet integration
ENV SCARB_VERSION="v2.8.2"
ENV SHELL="/bin/bash"
RUN curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- ${SCARB_VERSION}
ENV PATH="/root/.local/bin:${PATH}"
RUN scarb --version

# Install runtime dependencies
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates busybox && \
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Build the application in release mode
RUN cargo build --release

# Stage 2: Create the final runtime image
FROM debian:bookworm-slim

FROM debian:bookworm
# Install runtime dependencies
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates && \
apt-get autoremove -y; \
apt-get clean; \
RUN apt-get -y update && \
apt-get install -y openssl ca-certificates &&\
apt-get autoremove -y; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /usr/local/bin

# Copy the compiled binary from the builder stage
COPY --from=builder /usr/src/madara/target/release/madara .

# Chain presets to be mounted at startup
VOLUME crates/primitives/chain_config/presets
VOLUME crates/primitives/chain_config/resources

# Set the entrypoint
ENTRYPOINT ["./madara"]
Loading

0 comments on commit 6e69868

Please sign in to comment.