Skip to content

Commit

Permalink
feat(cli): add cli docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
GMKrieger committed Aug 14, 2024
1 parent 9f9637a commit 9c194b0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,24 @@ RUN go mod download
# Build application.
COPY . .
RUN go build -ldflags "-s -w -X 'main.buildVersion=${ROLLUPS_NODE_VERSION}'" ./cmd/cartesi-rollups-node
RUN go build -ldflags "-s -w -X 'main.buildVersion=${ROLLUPS_NODE_VERSION}'" ./cmd/cartesi-rollups-cli

# =============================================================================
# STAGE: rollups-node-cli
#
# This stage builds the Go binaries. First it downloads the external
# dependencies and then it builds the binaries.
# =============================================================================

FROM golang:${GO_VERSION}-bookworm AS rollups-node-cli
ARG GO_BUILD_PATH
WORKDIR ${GO_BUILD_PATH}

# Copy Go binary.
COPY --from=go-builder ${GO_BUILD_PATH}/cartesi-rollups-cli /usr/bin

# Set the Go supervisor as the command.
CMD [ "cartesi-rollups-cli" ]

# =============================================================================
# STAGE: rollups-node
Expand Down
7 changes: 7 additions & 0 deletions build/compose-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ services:
ports:
- 8545:8545

cli:
depends_on:
database:
condition: service_healthy
image: cartesi/rollups-node-cli:devel
command: cartesi-rollups-cli db upgrade -p postgres://postgres:password@database:5432/postgres?sslmode=disable

node:
depends_on:
devnet:
Expand Down
9 changes: 9 additions & 0 deletions build/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ group "default" {
"rollups-node",
"rollups-node-snapshot",
"rollups-node-devnet",
"rollups-node-cli",
]
}

Expand Down Expand Up @@ -37,6 +38,14 @@ target "rollups-node" {
}
}

target "rollups-node-cli" {
inherits = ["common"]
target = "rollups-node-cli"
args = {
ROLLUPS_NODE_VERSION = "devel"
}
}

target "rollups-node-snapshot" {
inherits = ["common"]
target = "rollups-node-snapshot"
Expand Down
4 changes: 4 additions & 0 deletions build/docker-bake.override.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ target "rollups-node" {
tags = ["${DOCKER_ORGANIZATION}/rollups-node:${TAG}"]
}

target "rollups-node-cli" {
tags = ["${DOCKER_ORGANIZATION}/rollups-node-cli:${TAG}"]
}

target "rollups-node-snapshot" {
tags = ["${DOCKER_ORGANIZATION}/rollups-node-snapshot:${TAG}"]
}
Expand Down

0 comments on commit 9c194b0

Please sign in to comment.