I've started playing with Docker a few days ago and I've been able to dockerise my first server. But with a couple of quirks. One is related to file permissions in a directory of copied resources. See the following shell session in the container:
1dfcc66f2344:/etc/jetty8% pwd
/etc/jetty8
1dfcc66f2344:/etc/jetty8% id
uid=1000(web) gid=111(jetty) groups=111(jetty)
1dfcc66f2344:/etc/jetty8% ls -al
total 68
drwxr-xr-x 5 web jetty 4096 Nov 30 16:07 .
drwxr-xr-x 119 root root 4096 Nov 30 16:43 ..
drwxrwx--- 2 web jetty 4096 Nov 30 16:07 contexts
-rw-rw---- 1 web jetty 1004 Nov 26 12:35 jetty-contexts.xml
-rw-rw---- 1 web jetty 1452 Nov 26 12:35 jetty-logging.xml
-rw-rw---- 1 web jetty 2277 Nov 26 12:35 jetty-shared-webapps.xml
-rw-rw---- 1 web jetty 169 Nov 26 12:35 jetty.conf
-rw-rw---- 1 web jetty 3637 Nov 26 12:35 jetty.xml
-rw-rw---- 1 web jetty 8507 Nov 26 12:35 start.config
-rw-rw---- 1 web jetty 24426 Nov 26 12:35 webdefault.xml
1dfcc66f2344:/etc/jetty8% cd contexts
contexts: Permission denied.
As you can see, contexts
should be accessible by the user web
who owns it. But it can't actually access the directory.
That directory is installed with the following section in Dockerfile
.
COPY resources/etc/jetty8 /etc/jetty8/
RUN chown -R web:jetty /etc/jetty8/
I'm running it from a Mac OS X host, by means of boot2docker
.
Thanks.