Redocly / Redocly/redocly-cli

preview-docs in Docker image doesn't exit on ctrl+c

Open
#1,698 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

p3 Type: Bug
Dominant language
TypeScript
Stars
1.5k
Forks
228
Avg merge
1d 14h
Merged PRs (30d)
48

Description

Describe the bug

When running the preview-docs command using the Docker image, it doesn't respond to ctrl+c to exit.

To Reproduce
Steps to reproduce the behaviour:

  1. Create a valid openapi.yaml file.

  2. Run this command:

     docker run --rm -p 8080:8080 -v $PWD:/spec redocly/cli preview-docs \
     openapi.yaml --use-community-edition --host 0.0.0.0
    
  3. Try to exit by pressing ctrl+c as you would do with the npm version

  4. Note that redocly hasn't exited.

Note, I have also tried adding the -t and -i flags to the docker command.

Expected behaviour

The docker container exits and control is returned to the shell in the terminal.

i.e. I expected it to behave in the same way as docker run redis does when you press ctrl+c.

Redocly Version(s)

$ docker run --rm redocly/cli --version
1.22.0

Node.js Version(s)

Whatever is in the Docker image.

OS, environment

MacOS 14.6.1 (Apple Silicon). Docker Desktop 4.31.0 (153195).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the documented docker run ... preview-docs command and inspect the preview-docs entry point and Docker image behavior. Confirm that Ctrl+C exits the container and returns control to the shell, while preserving the npm command's behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.