Add note in README about docker user id
[src/xds/xds-server.git] / README.md
index 6197418..0895e2a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -39,7 +39,7 @@ been integrated into AGL SDK docker container.
 Load the pre-build AGL SDK docker image including `xds-server`:
 
 ```bash
-wget -O - http://iot.bzh/download/public/2017/XDS/docker/docker_agl_worker-xds-latest.tar.xz | docker load
+seb@laptop ~$ wget -O - http://iot.bzh/download/public/2017/XDS/docker/docker_agl_worker-xds-latest.tar.xz | docker load
 ```
 
 ### List container
@@ -48,9 +48,9 @@ You should get `docker.automotivelinux.org/agl/worker-xds:X.Y` image
 
 ```bash
 # List image that we just built
-docker images | grep worker-xds
+seb@laptop ~$ docker images | grep worker-xds
 
-docker.automotivelinux.org/agl/worker-xds       3.2                 786d65b2792c        6 days ago          602MB
+docker.automotivelinux.org/agl/worker-xds       3.99.1              786d65b2792c        6 days ago          602MB
 ```
 
 ### Start xds-server within the container
@@ -62,12 +62,12 @@ Use provided script to create a new docker image and start a new container:
 seb@laptop ~$ wget https://raw.githubusercontent.com/iotbzh/xds-server/master/scripts/xds-docker-create-container.sh
 
 # Create new XDS worker container
-seb@laptop ~$ bash ./xds-docker-create-container.sh 0 docker.automotivelinux.org/agl/worker-xds:3.99.1
+seb@laptop ~$ bash ./xds-docker-create-container.sh
 
 # Check that new container is running
 seb@laptop ~$ docker ps | grep worker-xds
 
-b985d81af40c        docker.automotivelinux.org/agl/worker-xds:3.99.1       "/usr/bin/wait_for..."   6 days ago           Up 4 hours          0.0.0.0:8000->8000/tcp, 0.0.0.0:69->69/udp, 0.0.0.0:10809->10809/tcp, 0.0.0.0:2222->22/tcp    agl-worker-seb@laptop-0-seb
+b985d81af40c        docker.automotivelinux.org/agl/worker-xds:3.99.1       "/usr/bin/wait_for..."   6 days ago           Up 4 hours          0.0.0.0:8000->8000/tcp, 0.0.0.0:69->69/udp, 0.0.0.0:10809->10809/tcp, 0.0.0.0:2222->22/tcp    agl-xds-seb@laptop-0-seb
 ```
 
 This container (ID=0) exposes following ports:
@@ -76,6 +76,25 @@ This container (ID=0) exposes following ports:
 - 69   : TFTP
 - 2222 : ssh
 
+#### Manually setup docker user id
+
+If you plan to **use path-mapping sharing type for your projects**, you need to have the same user id and group id inside and outside docker. By default user and group name inside docker is set `devel` (id `1664`), use following commands to replace id `1664` with your user/group id:
+```bash
+# Set docker container name to use (usually agl-xds-xxx where xxx is USERNAME@MACHINENAME-IDX-NAME)
+seb@laptop ~$ export CONTAINER_NAME=agl-xds-seb@laptop-0-seb
+
+# First stop xds-server
+seb@laptop ~$ docker exec ${CONTAINER_NAME} bash -c ""
+
+# Change user and group id inside docker to match your ids
+seb@laptop ~$ docker exec ${CONTAINER_NAME} bash -c "usermod -u $(id -u) devel"
+seb@laptop ~$ docker exec ${CONTAINER_NAME} bash -c "groupmod -g $(id -g) devel"
+
+# Update some files ownership
+seb@laptop ~$ docker exec ${CONTAINER_NAME} bash -c "chown -R devel:devel /home/devel /tmp/xds"
+```
+
+
 **`xds-server` is automatically started** as a service on container startup.
 
 If the container is running on your localhost, you can access the web interface (what we call the "Dashboard"):