This message was deleted.
# rancher-desktop
a
This message was deleted.
c
You should be able to. Are you experiencing an issue with mounting a local directory to a container, or is there a different error you're seeing?
q
yeah, they aren't mounting...
c
Are you able to see the mounts?
Copy code
docker inspect -f '{{ .Mounts }}' container_name
q
window 1:
Copy code
% ls html ; docker run --name test-alpine --rm -v html:/usr/share/nginx/html:ro -v etc:/etc/nginx/conf.d:ro nginx:1-alpine
503.html	50x.html
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: can not modify /etc/nginx/conf.d/default.conf (read-only file system?)
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2023/10/23 21:39:59 [notice] 1#1: using the "epoll" event method
2023/10/23 21:39:59 [notice] 1#1: nginx/1.25.2
2023/10/23 21:39:59 [notice] 1#1: built by gcc 12.2.1 20220924 (Alpine 12.2.1_git20220924-r10)
2023/10/23 21:39:59 [notice] 1#1: OS: Linux 6.1.51-0-virt
2023/10/23 21:39:59 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2023/10/23 21:39:59 [notice] 1#1: start worker processes
2023/10/23 21:39:59 [notice] 1#1: start worker process 21
2023/10/23 21:39:59 [notice] 1#1: start worker process 22
2023/10/23 21:39:59 [notice] 1#1: start worker process 23
2023/10/23 21:39:59 [notice] 1#1: start worker process 24
2023/10/23 21:39:59 [notice] 1#1: start worker process 25
2023/10/23 21:39:59 [notice] 1#1: start worker process 26
window 2:
Copy code
% docker exec -it test-alpine ls /usr/share/nginx/html
50x.html    index.html
Copy code
[{volume html /var/lib/docker/volumes/html/_data /usr/share/nginx/html local ro false } {volume etc /var/lib/docker/volumes/etc/_data /etc/nginx/conf.d local ro false }]
Copy code
lima-rancher-desktop:/$ sudo ls /var/lib/docker/volumes/html/_data
50x.html    index.html
interesting
there are volumes here
it feels like they're coming from the image itself
as opposed to my
-v
that's certainly not what I expect
(I don't know what docker-desktop does)
c
hmm, I'm guessing that the
nginx:1-alpine
image isn't readily available for testing? Are you able to put together a minimal example to test with?
q
that's the real docker image ๐Ÿ™‚ = 100% public.
there's one file in `etc`:
the
html
folder has two files
50x.html
and
503.html
, you can put whatever you like in them
c
ah, I see the
1-alpine
tag now ๐Ÿ™‚
q
i only ran into that tag today, but it felt right!
i suppose i could use
nginx:alpine
...
1.25.2
and
mainline
felt too specific and too general/long ๐Ÿ™‚, I didn't read far enough over to see
alpine
...
(removes
1-
from the pod definition for future use...)
For perspective, I'm able to deploy roughly this using a kubernetes manifest:
But I was hoping to test using
docker
(in RD) before I assembled that...
c
I don't think the image is the issue, I just tested an example in on macOS using
:latest
and
1-alpine
and they behaved the same way (save for
1-alpine
requiring
/bin/sh
instead of
bin/bash
)
q
behaved how? -- where you able to put things there?
c
Yes
q
๐Ÿ˜•
c
I was able to mount an an example
nginx.conf
via
docker run -d -p 8080:80 -v $(pwd)/nginx_config:/etc/nginx/conf.d --name nginx-test nginx:1-alpine
๐Ÿ˜ฎ 1
q
i wasn't using
$(pwd)
ok, using
$(pwd)/
works...
c
hah, good catch!
q
now i just need to figure out where i saw
docker run ... -v
notation ๐Ÿ˜ž
the examples all resolve to absolute paths
would it kill
docker run
to warn about whatever-the-f it's doing here?
google for
docker "name value"
does not yield remotely useful results
yet another reminder that i absolutely hate docker
anyway, thanks...
๐Ÿ™Œ 1