Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 17 additions & 3 deletions packages/sdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

################################################################################
# base image
FROM ${CARTESI_BASE_IMAGE} AS base

Check warning on line 8 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${CARTESI_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
ARG DEBIAN_FRONTEND=noninteractive
RUN <<EOF
Expand Down Expand Up @@ -47,6 +47,16 @@
RUN curl -fsSL https://github.com/foundry-rs/foundry/releases/download/v${FOUNDRY_VERSION}/foundry_v${FOUNDRY_VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz \
| tar -zx -C /usr/local/bin

################################################################################
# nitro installer
FROM builder AS nitro
ARG NITRO_VERSION
WORKDIR /usr/local/src
ADD https://github.com/leahneukirchen/nitro.git#v${NITRO_VERSION} /usr/local/src
RUN <<EOF
make
EOF

################################################################################
# go migrate db cli installer
FROM base AS go-migrate
Expand Down Expand Up @@ -149,16 +159,21 @@
COPY --from=graphql /usr/local/bin/cartesi-rollups-graphql /usr/local/bin/
COPY --from=go-migrate /usr/local/bin/migrate /usr/local/bin/
COPY --from=graphql-migration /usr/share/cartesi/rollups-graphql/migrations /usr/share/cartesi/rollups-graphql/migrations
COPY --from=su-exec /usr/local/src/su-exec /usr/local/bin/
COPY --from=nitro /usr/local/src/nitro /usr/local/bin/
COPY --from=nitro /usr/local/src/nitroctl /usr/local/bin/
COPY skel/ /
RUN mkdir -p /run/nitro && chown -R cartesi:cartesi /run/nitro

USER cartesi

################################################################################
# postgresql initdb
FROM ${POSTGRES_BASE_IMAGE} AS postgresql-initdb

Check warning on line 172 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${POSTGRES_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

ARG DEBIAN_FRONTEND=noninteractive
RUN <<EOF
set -eo
set -e
apt-get update
apt-get install -y --no-install-recommends \
libslirp0
Expand All @@ -169,7 +184,7 @@
COPY --from=go-migrate /usr/local/bin/migrate /usr/local/bin/
COPY --from=graphql-migration /usr/share/cartesi/rollups-graphql/migrations /usr/share/cartesi/rollups-graphql/migrations

ARG POSTGRES_PASSWORD=password

Check warning on line 187 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ARG "POSTGRES_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

# create rollupsdb and graphql databases
COPY <<EOF /docker-entrypoint-initdb.d/00-createdb.sql
Expand Down Expand Up @@ -197,12 +212,12 @@

################################################################################
# rollups-database image
FROM ${POSTGRES_BASE_IMAGE} AS rollups-database

Check warning on line 215 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG ${POSTGRES_BASE_IMAGE} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
COPY --from=postgresql-initdb /var/lib/postgresql/data /var/lib/postgresql/data

################################################################################
# alto build
FROM node:${NODE_VERSION} AS alto

Check warning on line 220 in packages/sdk/Dockerfile

View workflow job for this annotation

GitHub Actions / build

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG node:${NODE_VERSION} results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/
ARG ALTO_VERSION
ARG NODE_VERSION
ARG FOUNDRY_VERSION
Expand All @@ -217,6 +232,7 @@
COPY alto.patch /app/alto.patch

RUN <<EOF
set -eu
npm install -g pnpm
git clone --branch v${ALTO_VERSION} --depth 1 --recurse-submodules https://github.com/pimlicolabs/alto.git
cd alto
Expand All @@ -242,7 +258,6 @@
ARG NODE_VERSION
ARG NVM_VERSION
ARG TARGETARCH
ARG TARGETARCH
ARG XGENEXT2_VERSION

USER root
Expand Down Expand Up @@ -339,7 +354,6 @@
COPY eth_load /usr/local/bin

COPY entrypoint.sh /usr/local/bin/
COPY --from=su-exec /usr/local/src/su-exec /usr/local/bin/
COPY --from=foundry /usr/local/bin/anvil /usr/local/bin/
COPY --from=foundry /usr/local/bin/cast /usr/local/bin/

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ target "default" {
CARTESI_PAYMASTER_VERSION = "0.2.0"
CARTESI_ROLLUPS_GRAPHQL_VERSION = "2.3.14"
CARTESI_ROLLUPS_NODE_VERSION = "2.0.0-alpha.7"
CRANE_VERSION = "0.19.1"
FOUNDRY_VERSION = "1.2.1"
GO_MIGRATE_VERSION = "4.18.2"
NITRO_VERSION = "0.3"
NODE_VERSION = "22.15.1"
NVM_VERSION = "977563e97ddc66facf3a8e31c6cff01d236f09bd" # 0.40.3
POSTGRES_BASE_IMAGE = "docker.io/library/postgres:17-trixie@sha256:8a56bef4c60bef3d26193cb9d810fce93def8fd0c459f4a9b14240fbd7559a1d"
Expand Down
2 changes: 2 additions & 0 deletions packages/sdk/skel/etc/nitro/cartesi-rollups-advancer/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
exec cartesi-rollups-advancer
2 changes: 2 additions & 0 deletions packages/sdk/skel/etc/nitro/cartesi-rollups-claimer/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
exec cartesi-rollups-claimer
2 changes: 2 additions & 0 deletions packages/sdk/skel/etc/nitro/cartesi-rollups-evm-reader/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
exec cartesi-rollups-evm-reader
2 changes: 2 additions & 0 deletions packages/sdk/skel/etc/nitro/cartesi-rollups-jsonrpc-api/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
exec cartesi-rollups-jsonrpc-api
2 changes: 2 additions & 0 deletions packages/sdk/skel/etc/nitro/cartesi-rollups-validator/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
exec cartesi-rollups-validator
Loading