Could someone help me add a mount to a template?
I found a template
https://github.com/bpmct/coder-templates/tree/main/desktop-container
But I want to be able to share a file between it and the host so id like to mount a host directory as a volume in the container. however im new to everything so idk what I'm doing
GitHub
coder-templates/desktop-container at main · bpmct/coder-templates
Templates I use for my Coder deployment. Contribute to bpmct/coder-templates development by creating an account on GitHub.
15 Replies
i see volumes in the main.tf but i dont think this is what im looking for
I look at this but see nothing
ok i think i got it but jees this doesnt seem newbie friendly
it is
it isn't
ahaha
ok i found a thing to put in docker_container
changed it to
mounts {
.....
}
seems to work
ah poop seems theres an error with the template
fails to start
Error: Error response from daemon: invalid reference format: repository name must be lowercase
i dont even know what repository its talking about
MY GOD
its because it used my username
which has capitals in
what kind of bs is that
well you don't really wanna do that
take a look at this
https://github.com/uwu/basic-env/blob/cde3dd38bd691f2e15554042b3fa3ad930ed13c0/main.tf#L181
L181-183 and L223-227
whats wrong with my way?
with my limited knowdglete the volume one doesnt actually bind a directory
volumes are directories
automatically created and managed by docker
you don't really want to use mounts because every template will have the same directory mounted
hmm, ok but i though volumes wherre some files. otherwise i would have just copied my files into them
wdym ?
well i wanted to share some files to my docker container
i didnt know how. i thought i saw something that container volumes where just files in some location like /var (idk)
but i had to use docker cp to copy over files
they are
/var/lib/docker/volumes
they're folders
but managed by docker
it all depends on what you want to do
is it single-use or do you want the files to persist on container restart ?
I care little for persistance. my server is on all the time with the workspaces and my code is pushed to github frequently
yeah so then
you can use
coder config-ssh
on your workstation/computer
then use the sftp cli to transfer files
or use the vcode ssh extensionhmm ok