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



From a docker perspective, we can make a highly customizable image. For example, let's say we have this entrypoint.sh with the following contents


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

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20