dockerfile and $@
The $@ symbol are basically expanding or executing arguments passed from a client/entry point to the executing code.
Let's say for example we have a file call ./hello2.sh
#!/bin/bash
echo "Hello, World! - Argument: $@"
if we run hello2.sh test1 test2 test3
We will get the following output
entrypoint.sh
#!/bin/bash
ldconfig 2>/dev/null || echo 'unable to refresh ld cache, not a big deal in most cases'
source /usr/src/.venv/bin/activate
exec text-generation-launcher $@
And in my dockerfile,
Dockerfile
ENTRYPOINT ["/entrypoint.sh"]
CMD ["--model-id", "tiiuae/falcon-40b-instruct"]
When my container runs, essentially what i am executing will be as follows.
/entrypoint.sh --model-id tiiuae/falcon-40b-instruct
which in turn calls
./text-generation-launcher --model-id tiiuae/falcon-40b-instruct
In another scenario, after building the image, if i were to run
docker run my-image --model-id mistralai/Mistral-7B-Instruct-v0.1
./text-generation-launcher --model-id mistralai/Mistral-7B-Instruct-v0.1
Comments