File tree Expand file tree Collapse file tree 2 files changed +43
-4
lines changed
Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 1616
1717 name : Build Image
1818 runs-on : ubuntu-latest
19- defaults :
20- run :
21- working-directory : solana-programs
2219 steps :
2320 - name : Check out code
2421 uses : actions/checkout@v2
8683 IMAGE_TAG : ${{ env.VERSION }}
8784 run : |
8885 REGISTRY_ALIAS=$(aws ecr-public describe-registries | jq --raw-output .registries[0].registryId)
89- docker build -t $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:$IMAGE_TAG $CONTAINER_PATH
86+ docker build -t $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:$IMAGE_TAG . -f $CONTAINER_PATH.Dockerfile
9087 docker push $ECR_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:$IMAGE_TAG
Original file line number Diff line number Diff line change 1+ # Build stage
2+ FROM rust:1.76-slim-bullseye as builder
3+
4+ # Install system dependencies and clean up in the same layer
5+ RUN apt-get update && \
6+ apt-get install -y --no-install-recommends \
7+ pkg-config \
8+ build-essential \
9+ libudev-dev \
10+ protobuf-compiler && \
11+ rm -rf /var/lib/apt/lists/* && \
12+ rm -rf /tmp/*
13+
14+ WORKDIR /app
15+ COPY . .
16+
17+ # Build with cleanup
18+ RUN cargo build --release --package tuktuk-crank-turner && \
19+ rm -rf /app/target/release/deps && \
20+ rm -rf /app/target/release/build && \
21+ rm -rf /usr/local/cargo/registry
22+
23+ # Runtime stage
24+ FROM debian:bullseye-slim
25+
26+ # Install runtime dependencies with minimal installation
27+ RUN apt-get update && \
28+ apt-get install -y --no-install-recommends \
29+ ca-certificates \
30+ libssl-dev && \
31+ rm -rf /var/lib/apt/lists/* && \
32+ rm -rf /tmp/*
33+
34+ WORKDIR /app
35+
36+ # Copy the binary from builder
37+ COPY --from=builder /app/target/release/tuktuk-crank-turner /usr/local/bin/
38+
39+ # Create directory for key file
40+ RUN mkdir -p /app/keys
41+
42+ ENTRYPOINT ["tuktuk-crank-turner" ]
You can’t perform that action at this time.
0 commit comments