https://rancher.com/ logo
Title
a

able-midnight-97613

10/04/2022, 9:38 PM
volume mounts query - dont understand why a file shows up as directory inside the container. thoughts?
$ cat /tmp/local-gbs-user/init.sql 
IF DB_ID('backend_sim') IS NULL
CREATE DATABASE backend_sim;
GO
$ docker run --rm -t
i --name sqlinit -v /tmp/local-gbs-user/init.sql:/sql/init.sql --entrypoint bash australia-southeast1-docker.pkg.dev/gb-plat-dev-gar-v1/apps-docker-repo/mcr.microsoft.com/mssql-tools:latest-1205
bob@778f2f0b5ba0:/$ cat /sql/init.sql
cat: /sql/init.sql: Is a directory
rancher desktop on macos catalina
f

flaky-dusk-65029

10/05/2022, 8:54 PM
hm, my understanding is that when you mount a volume with that
-v
flag, it mounts directories, not individual files. so that flag mounted that file
/tmp/local-gbs-user/init.sql
to a dir called
/sql/init.sql
you should probably be doing
-v /tmp/local-gbs-user:/sql
a

able-midnight-97613

10/07/2022, 12:20 AM
forgot to mention that mounted the file as a directory too which felt very weird
$ cat /tmp/local-gbs-user/init.sql 
IF DB_ID('backend_sim') IS NULL
CREATE DATABASE backend_sim;
GO
$ docker run --rm -ti --name sqlinit -v /tmp/local-gbs-user:/sql --entrypoint bash australia-southeast1-docker.pkg.dev/gb-plat-dev-gar-v1/apps-docker-repo/mcr.microsoft.com/mssql-tools:latest-1205
bob@c07e5a242ee1:/$ cat /sql/init.sql
cat: /sql/init.sql: Is a directory
f

flaky-dusk-65029

10/07/2022, 8:58 PM
..then in that case , what you're doing seems fine. That said, i've only ever mounted directories:directories, never files:files . sorry!
a

able-midnight-97613

10/10/2022, 3:07 AM
what next? should i deal with this via github issues?