Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

docker: invalid reference format using ${PWD} on WIndows

I want to run docker container (Windows) using the following shell file configuration:

# Variables
model="Llama-2-7b-chat"
volume="$PWD/data"

# Echo starting message
echo "Starting the Docker container with local files (No Internet): $model and volume: $volume ..."

# Start the Docker container
docker run --rm --entrypoint /bin/bash -itd \
  --name $model \
  -v $volume:/data \
  -p 8080:80 ghcr.io/huggingface/text-generation-inference:latest

When I start .sh script I get the following error:

$ ./run_llama_2.sh
Starting the Docker container with local files (No Internet): Llama-2-7b-chat and volume: /c/Users/user_name/llama_chat/data ...
docker: invalid reference format.

It has something to do with volume="$PWD/data". How can I correct the format?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You should expand your variables:

$ docker run --rm --entrypoint /bin/bash -itd \
  --name "$model" \
  -v "$volume":/data \
  -p 8080:80 ghcr.io/huggingface/text-generation-inference:latest
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading