mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00

# Aider chat conversation: USER: add a port fwd so a client inside the contain can connect to the ollama server running on the host ASSISTANT: To forward a port so that a client inside the container can connect to the Ollama server running on the host, you need to add a `--publish` or `-p` option to the `docker run` command in the `benchmark/docker.sh` script. This option takes the format `host_port:container_port`. Assuming the Ollama server is running on port 12345 on the host, and you want to use the same port inside the container, the diff would look like this: ```diff --- benchmark/docker.sh +++ benchmark/docker.sh @@ ... @@ docker run \ -it --rm \ -v `pwd`:/aider \ -v `pwd`/tmp.benchmarks/.:/benchmarks \ -e OPENAI_API_KEY=$OPENAI_API_KEY \ -e HISTFILE=/aider/.bash_history \ -e AIDER_DOCKER=1 \ -e AIDER_BENCHMARK_DIR=/benchmarks \ + -p 12345:12345 \ aider-benchmark \ bash ``` This change will forward port 12345 from the host to port 12345 in the container, allowing a client inside the container to connect to the Ollama server running on the host machine.
13 lines
333 B
Bash
Executable file
13 lines
333 B
Bash
Executable file
#!/bin/bash
|
|
|
|
docker run \
|
|
-it --rm \
|
|
-v `pwd`:/aider \
|
|
-v `pwd`/tmp.benchmarks/.:/benchmarks \
|
|
-e OPENAI_API_KEY=$OPENAI_API_KEY \
|
|
-e HISTFILE=/aider/.bash_history \
|
|
-e AIDER_DOCKER=1 \
|
|
-e AIDER_BENCHMARK_DIR=/benchmarks \
|
|
-p 12345:12345 \
|
|
aider-benchmark \
|
|
bash
|