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
Fruit Flan
Fruit FlanOP2y ago
i see volumes in the main.tf but i dont think this is what im looking for I look at this but see nothing
Fruit Flan
Fruit FlanOP2y ago
ok i think i got it but jees this doesnt seem newbie friendly
Phorcys
Phorcys2y ago
it is it isn't
Fruit Flan
Fruit FlanOP2y ago
ahaha ok i found a thing to put in docker_container
mounts [
{
target="/mnt/rd-volume"
source="/mnt/sdb1/docker-rd-volum"
type="volume"
}
mounts [
{
target="/mnt/rd-volume"
source="/mnt/sdb1/docker-rd-volum"
type="volume"
}
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
Phorcys
Phorcys2y ago
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
Fruit Flan
Fruit FlanOP2y ago
whats wrong with my way? with my limited knowdglete the volume one doesnt actually bind a directory
Phorcys
Phorcys2y ago
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
Fruit Flan
Fruit FlanOP2y ago
hmm, ok but i though volumes wherre some files. otherwise i would have just copied my files into them
Phorcys
Phorcys2y ago
wdym ?
Fruit Flan
Fruit FlanOP2y ago
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
Phorcys
Phorcys2y ago
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 ?
Fruit Flan
Fruit FlanOP2y ago
I care little for persistance. my server is on all the time with the workspaces and my code is pushed to github frequently
Phorcys
Phorcys2y ago
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 extension
Fruit Flan
Fruit FlanOP2y ago
hmm ok
Want results from more Discord servers?
Add your server