Skip to content

FIX: Ignite CLI Docker container exits immediately after container restart #4852

@martinyi1210

Description

@martinyi1210

Context

I used Ignite CLI to run my Cosmos SDK chain inside a Docker container.
The container starts and the chain runs normally the first time.

However, after stopping the container and starting it again, the container exits immediately instead of keeping the chain running.

This issue blocks normal development workflow because the container cannot be restarted reliably after being stopped.

No major code changes were made between runs. The issue appears to be related to how Ignite CLI behaves inside Docker when restarting an existing container.

Describe the Bug

When running Ignite CLI inside a Docker container:

The container runs normally on first start

After stopping the container

Restarting the same container causes it to exit immediately

The chain does not stay running in the background

This behavior is unexpected, as the container should continue running the chain process after restart.

Steps to Reproduce

Create or use an existing Cosmos SDK chain with Ignite CLI

Run Ignite CLI inside a Docker container (e.g. using ignite chain serve)

Confirm that the container and chain are running normally

Stop the Docker container

docker stop <container_name>

Start the container again

docker start <container_name>

Observe that the container exits immediately

Expected Behavior

After restarting the Docker container:

The Ignite CLI process should continue running

The Cosmos chain should start and stay alive

The container should remain in a running state

Actual Behavior

The Docker container exits immediately after restart

The chain does not stay running

No interactive prompt is available

The container must be recreated to run successfully again

Environment Details

OS: Linux (Docker container)

docker-compose.yml

services:
  ignite:
    image: ignitehq/cli:v29.6.2
    container_name: ingsha-ignite
    tty: true
    stdin_open: true

    working_dir: /apps

    volumes:
      # Ignite CLI 的 home & cache
      - ../sdh:/home/tendermint

      - ../src:/apps

    ports:
#      - "1317:1317"   # Cosmos REST API
      - "26657:26657" # Tendermint RPC
#      - "4500:4500"   # gRPC
#    environment:
#      - HOME=/home/tendermint

#    restart: always
    command: bash




Ignite Version:

Ignite CLI version: ignitehq/cli:v29.6.2
Ignite CLI config version: ignitehq/cli:v29.6.2
Cosmos SDK version: v0.53.5

Go Version:
(Go is provided inside the Ignite Docker image)

Docker: Docker Engine (latest stable)

Notes

The issue only occurs after restarting an existing container

First-time container execution works correctly

This might be related to:

Ignite CLI running in interactive mode

Process lifecycle / TTY handling inside Docker

ignite chain serve not being suitable as PID 1 without a wrapper

Using docker exec to manually start the chain again

However, a reliable restart behavior is expected when using Ignite CLI in Docker-based workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions