Skip to content

Need some advices on how to build docker for cc-switch-cli #253

@Noodle05

Description

@Noodle05

I'm trying to build a docker image for cc-switch-cli proxy, but facing some issues, and want to get some advices from everybody.

The plan is:
When build docker image:

  1. Download and add cc-switch (cli) into /usr/local/bin
  2. Add provider
  3. Do not hardcode api_key into docker image
  4. Use foreground to launch cc-switch proxy

The issues I'm facing are:

  • How to add provider during docker build. Currently adding provider is an inactive operation. I can find most close one is: "cc-switch add provider -a codex --template deepseek", but still need to provider more information during an inactive session. Cannot be done during docker image build.
  • How to use API_KEY from env? without provide a deepseek api key, it will not allow to create provider. This is not secure for docker image.
  • How to start proxy without codex. When I try to run launch proxy with command "cc-switch proxy serve --takeover codex", it complaining "Error: write Codex live config failed: Codex model catalog template gpt-5.5 not found. Please start Codex once so models_cache.json is available, or ensure the codex CLI is on PATH.". Without codex cli, it will refuse to start.

Ideally, cc-switch proxy should be run in a separate docker container, which has no codex installed. I know this may requires cc-switch change to support, but maybe I missed something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions