Skip to content

Commit ff965c1

Browse files
authored
Windows sidecar (#210)
Fixes issue where sidecar could not be started when the docker host is Windows
1 parent 89c582c commit ff965c1

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@
44
VERSION := $(shell cat /proc/version)
55
# SAN this is a hack so that docker-compose works in the linux virtual environment under Windows
66
ifneq (,$(findstring Microsoft,$(VERSION)))
7-
export DOCKER_COMPOSE=docker-compose.exe
8-
export DOCKER=docker.exe
7+
export DOCKER_COMPOSE=docker-compose
8+
export DOCKER=docker
9+
export RUN_DOCKER_ENGINE_ROOT=1
910
else
1011
export DOCKER_COMPOSE=docker-compose
1112
export DOCKER=docker
13+
export RUN_DOCKER_ENGINE_ROOT=0
1214
endif
1315

1416
PY_FILES = $(strip $(shell find services packages -iname '*.py' -not -path "*egg*" -not -path "*contrib*"))
15-
1617
export PYTHONPATH=${CURDIR}/packages/s3wrapper/src:${CURDIR}/packages/simcore-sdk/src
1718

1819
all:

services/docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ services:
103103
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
104104
- S3_SECRET_KEY=${S3_SECRET_KEY}
105105
- S3_BUCKET_NAME=${S3_BUCKET_NAME}
106+
- RUN_DOCKER_ENGINE_ROOT=${RUN_DOCKER_ENGINE_ROOT}
106107
depends_on:
107108
- rabbit
108109
#--------------------------------------------------------------------

services/sidecar/.docker/entrypoint.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ chown -R scu:scu /home/scu/input
1616
chown -R scu:scu /home/scu/output
1717
chown -R scu:scu /home/scu/log
1818

19-
su-exec scu "$@"
19+
if [[ ${RUN_DOCKER_ENGINE_ROOT} == "1" ]]
20+
then
21+
echo "running from windows host as root..."
22+
exec "$@"
23+
else
24+
su-exec scu "$@"
25+
fi

services/sidecar/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ VOLUME /home/scu/packages
6666
VOLUME /home/scu/services/sidecar
6767

6868
ENV DEBUG 1
69+
ENV RUN_DOCKER_ENGINE_ROOT=0
6970
USER root
7071
ENTRYPOINT [ "/bin/sh", ".docker/entrypoint.sh" ]
7172
CMD ./boot.sh
@@ -98,6 +99,7 @@ RUN . $HOME/.venv/bin/activate; pip list &&\
9899
rm -rf $HOME/services
99100

100101
ENV DEBUG 0
102+
ENV RUN_DOCKER_ENGINE_ROOT=0
101103
USER root
102104
ENTRYPOINT [ "/bin/sh", ".docker/entrypoint.sh" ]
103105
CMD ./boot.sh

0 commit comments

Comments
 (0)