# Docker: invalid reference format

**URL:** <https://forums.docker.com/t/docker-invalid-reference-format/98597>\
**Category:** General\
**Tags:** docker\
**Created:** [September 11, 2020, 3:10pm UTC](https://forums.docker.com/t/docker-invalid-reference-format/98597 "2020-09-11T15:10:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![basuocean](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/basuocean/32/28399_2.png) [@basuocean](https://forums.docker.com/u/basuocean)\
**Post date:** [September 11, 2020, 3:10pm UTC](https://forums.docker.com/t/docker-invalid-reference-format/98597/1 "2020-09-11T15:10:58Z")

</div>

**Error** : docker: invalid reference format.  
**HOST** : Windows 10  
**Scripting language** : Python  
**docker command used** :  
runc\_vvc\_docker\_container = ‘docker run -d --name ’ + container\_name + ’ --rm -v ’ + mount\_dir + ‘:/shared/vvc’ + ’ --privileged -p 2210:2210 -p 8010:8010 ’ + image\_to\_run + ’ tail -f /dev/null’  
print(runc\_vvc\_docker\_container)

output = os.system(runc\_vvc\_docker\_container)  
print(output)

**Backgroud** :  
I want to run the container in back-end, and run vvc custom configurations in later stage.(i.e vvc -u -c “custom\_config.cfg”)

**Strange behavior:**  
print(runc\_vvc\_docker\_container) results in → docker run -d --name SWQT --rm -v D:/Work/Blackhole/Azure\_Reference\_Repo/VRTE\_FCs/str-psx-emmc-utils/\_qt\_project:/shared/vvc --privileged -p 2210:2210 -p 8010:8010 [xyz.com/ela7si/vvc:imagename](http://xyz.com/ela7si/vvc:imagename) tail -f /dev/null

1. Above command when run on the windows command prompt manually - it runs with **no error.**
2. But when run through python script, results in **docker: invalid reference format.**

**# Working -**  
subprocess.call('docker run -it --name ’ + container\_name + ’ --rm -v ’ + mount\_dir + ':/shared/vvc ’ + '–privileged -p 2210:2210 -p 8010:8010 ’ + image\_to\_run, shell=True)

**# Not Working -** and also throws Error : docker: invalid reference format.  
subprocess.call('docker run -it --name ’ + container\_name + ’ --rm -v ’ + mount\_dir + ':/shared/vvc ’ + ‘–privileged -p 2210:2210 -p 8010:8010 ’ + image\_to\_run + **’ tail -f /dev/null** ’, shell=True)

**# Working -** runc\_vvc\_docker\_container = 'docker run -d --name ’ + container\_name + ’ --rm -v ’ + mount\_dir + ‘:/shared/vvc’ + ’ --privileged -p 2210:2210 -p 8010:8010 ’ + image\_to\_run  
os.system(runc\_vvc\_docker\_container)

**# Not Working** - runc\_vvc\_docker\_container = 'docker run -d --name ’ + container\_name + ’ --rm -v ’ + mount\_dir + ‘:/shared/vvc’ + ’ --privileged -p 2210:2210 -p 8010:8010 ’ + image\_to\_run + **’ tail -f /dev/null’**  
os.system(runc\_vvc\_docker\_container)

**Options tried** :

1. shared directory in all small letters
2. both windows and linux path separator(‘/’ and ‘') and also with double slahses (’//')
3. ried with and without interactive (-it) mode

output = os.system(runc\_vvc\_docker\_container)  
print(output) → **results in 125 error code.**
