Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions blockchain-vks/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/aztec-connect-cpp-x86_64-linux-clang
# ==========================================
# Stage 1: Source Extraction
# We name this stage 'cpp-source' to avoid brittle index referencing (like --from=0)
# ==========================================
FROM 278380418400.dkr.ecr.eu-west-2.amazonaws.com/aztec-connect-cpp-x86_64-linux-clang AS cpp-source

# ==========================================
# Stage 2: Builder / Runtime
# Upgraded to Node 20 (Active LTS) and newer Alpine for better security and performance.
# ==========================================
FROM node:20-alpine

# Install system dependencies
# Using --no-cache eliminates the need for 'apk update' and keeps the image small.
RUN apk add --no-cache bash curl

# Copy artifacts from the named stage (cpp-source)
COPY --from=cpp-source /usr/src/aztec-connect-cpp/ /usr/src/aztec-connect-cpp

FROM node:16-alpine3.15
RUN apk update && apk add --no-cache bash curl
COPY --from=0 /usr/src/aztec-connect-cpp/ /usr/src/aztec-connect-cpp
WORKDIR /usr/src/blockchain-vks

# Copy project files
# IMPORTANT: Ensure you have a .dockerignore file to exclude node_modules, .git, etc.
COPY . .
RUN ./generate_vks.sh

# Grant execution permissions and run the generation script
# This prevents "permission denied" errors if the file mode was lost during copy.
RUN chmod +x generate_vks.sh && ./generate_vks.sh