Advertisement
mindthump

Run container as current user

Jun 19th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.04 KB | None | 0 0
  1. docker run --user $(id -u):$(id -g) [...]
  2.  
  3.  
  4. For docker-compose:
  5.  
  6. In docker-compose.yml:
  7.  
  8. version: '3.3'
  9. services:
  10. foo:
  11. image: foo-app:latest
  12. command: ["foo"]
  13. user: ${CURRENT_UID}
  14.  
  15. Run it:
  16. CURRENT_UID=$(id -u):$(id -g) docker-compose up
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement