Skip to content

Instantly share code, notes, and snippets.

@keeb-zz
Created February 7, 2014 19:12
Show Gist options
  • Save keeb-zz/8869702 to your computer and use it in GitHub Desktop.
Save keeb-zz/8869702 to your computer and use it in GitHub Desktop.
Read/Writing as a different user
» ~ docker run -u nobody -i -t ubuntu touch /tmp/test
» ~
» ~ docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b360de514896 ubuntu:12.04 touch /tmp/test 5 seconds ago Exit 0 distracted_torvalds
» ~ docker commit b360de514896
73f2406aa2cd26d503992f9cfc8e28212bb0513f33094f74b34f4ed1e175c7bc
» ~ docker tag 73f2406aa2cd26d503992f9cfc8e28212bb0513f33094f74b34f4ed1e175c7bc nobody-test
» ~ docker run nobody-test ls -l /tmp
total 0
-rw-r--r-- 1 nobody nogroup 0 Feb 7 19:11 test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment