4 Aug 2021 |
b | i tried
- type: bind
source: ./global.rc
target: /etc/global.rc
- "./global.rc:/etc/global.rc"
- "$(pwd)/global.rc/etc/global.rc"
| 01:12:19 |
@kinow:matrix.org | I think you can use volumes for directories only. The latest cylc reads the global.rc from /etc/cylc/ . So you should be able to bind some local folder with your global.rc to /etc/cylc/ | 01:12:47 |
b | all of them cause docker to create a empty directory in its place | 01:12:53 |
@kinow:matrix.org | (I'm checking my folders to confirm .... ) | 01:12:54 |
b | In reply to @kinow:matrix.org I think you can use volumes for directories only. The latest cylc reads the global.rc from /etc/cylc/ . So you should be able to bind some local folder with your global.rc to /etc/cylc/ yeah, thats why they have the --mount option, but it seems like I cant find its equivalent in docker-compose | 01:13:40 |
b |
If you use --mount[...] Docker does not automatically create it for you, but generates an error.
| 01:14:07 |
@kinow:matrix.org | - type: bind
source: ./config/
target: /etc/cylc/
| 01:14:23 |
@kinow:matrix.org | Something like this I think ☝️ where you have your configuration files inside your local config folder. | 01:14:44 |
@kinow:matrix.org | I'm just trying to confirm where Cylc looks for files.... | 01:15:05 |
b | yeah, binding the full directory ofc is possible | 01:15:16 |
b | I wanted to just mount the one file | 01:15:34 |
b | but seems like i need to go directory | 01:15:41 |
b | just confused there s a run option, but nothing for compose | 01:16:10 |
@kinow:matrix.org | Ah, what if you pass the absolute directory of your file??? | 01:16:18 |
@kinow:matrix.org | You are passing the relative location.. I think the absolute location might work? | 01:16:44 |
@kinow:matrix.org | I remember having a similar issue with docker exec I think, and I was using -v localfile:blabla , and had to replace by ${PWD} | 01:17:16 |
@kinow:matrix.org | * I remember having a similar issue with docker exec I think, and I was using -v localfile:blabla , and had to replace by ${PWD}/localfile | 01:17:23 |
b | hm, i think it is the same for an absolute path | 01:18:15 |
b | if using exec or some i can really recommend using --mount | 01:18:32 |
b | like explained in the link I snet | 01:18:45 |
b | * like explained in the link I sent | 01:18:48 |
b | an absolute path isnt working either | 01:19:52 |
b | * hey guys - i have a question regarding using the --mount option in dokcer-compose, since i want to link a file without docker creating it for me if it doesnt exist on the host (https://docs.docker.com/storage/bind-mounts/#choose-the--v-or---mount-flag)
If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v creates the endpoint for you. It is always created as a directory. If you use --mount to bind-mount a file or directory that does not yet exist on the Docker host, Docker does not automatically create it for you, but generates an error.
| 01:24:19 |
@kinow:matrix.org | Here's what I tried:
kinow@ranma:/tmp/test-docker$ mkdir -p /tmp/test-docker && cd /tmp/test-docker
kinow@ranma:/tmp/test-docker$ echo "TEST" > global.rc
kinow@ranma:/tmp/test-docker$ docker run --rm -ti --mount type=bind,source="${PWD}/global.rc",target=/etc/global.rc debian:stable-slim /bin/bash
root@0ad09b680674:/# cat /etc/global.rc
TEST
root@0ad09b680674:/# exit
Then wrote this docker-compose.yml
version: "3"
services:
cylc:
image: "debian:stable-slim"
volumes:
- ${PWD}/global.rc:/etc/global.rc
And tested with:
kinow@ranma:/tmp/test-docker$ docker-compose run --rm cylc
root@cd233da49027:/# cat /etc/global.rc
TEST
root@cd233da49027:/# exit
| 01:37:16 |
@kinow:matrix.org | Now trying the volume from your example... | 01:37:27 |
@kinow:matrix.org | kinow@ranma:/tmp/test-docker$ cat docker-compose.yml
version: "3.3"
services:
cylc:
image: "debian:stable-slim"
volumes:
- type: bind
source: "${PWD}/global.rc"
target: "/etc/global.rc"
kinow@ranma:/tmp/test-docker$
kinow@ranma:/tmp/test-docker$
kinow@ranma:/tmp/test-docker$ docker-compose run --rm cylc
root@a92b834ddc3c:/# cat /etc/global.rc
TEST
root@a92b834ddc3c:/# exit
| 01:41:21 |
@kinow:matrix.org | Is that similar to what you are trying to do b ? | 01:41:35 |
b | yes | 01:42:35 |
19 Oct 2021 |
| @kinow:matrix.org left the room. | 20:57:18 |
19 Nov 2021 |
| mukesh bhakuni joined the room. | 19:01:47 |