Replies: 2 comments 1 reply
|
okay so But this still seems like I'm missing something here; I shouldn't need a custom entrypoint script to do this, right? |
1 reply
|
@njvack Can you try this with 1.1.0 or newer? Dockerfile: FROM alpine:latest
RUN apk add --no-cache openssh-client
USER guest
CMD ["/bin/sh"]container build -t test -f Dockerfile .
container run -v "${SSH_AUTH_SOCK}:/var/host-services/ssh-auth.sock" ls -l /var/host-services/ssh-auth.sock
container run -v "${SSH_AUTH_SOCK}:/var/host-services/ssh-auth.sock" -e SSH_AUTH_SOCK=/var/host-services/ssh-auth.sock test ssh-add -lThe #1751 fix means that I see this for the srw-rw-rw- 1 root root 0 Jul 29 16:27 /run/ssh-auth.sockAnd for the The |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey there,
I'm experimenting with
containerfor using AI agents for dev (more) safely. To this end, I'd like to be able to:I can use plain old
container run --sshand that maps my socket into/var/host-services/ssh-auth.sock-- but my normal user can't read it:I have a workaround involving the container starting as root and using a custom ENTRYPOINT script that does:
... which connects a second socket with more favorable permissions, and then execs a login shell as my non-root user, but woof
container machinedoes user mapping and sets up the SSH socket perfectly (/var/host-services/ssh-auth.sockis owned by my non-root user, yay!), but alas, I have all of $HOME right there.I read PR #1751 which suggests other sockets should get the same permission mapping as the ones connected by
--ssh, not that the ssh ones are wrong. So I feel like this is probably on my end, not oncontainerbut...? FWIW, I can build an image using this Dockerfile:and then:
All reactions