From 2d1515d12fb0477b1a97ef3de93d174b90bf7024 Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Fri, 4 Sep 2020 14:03:29 +0100 Subject: [PATCH] Allow the caller of docker-compose to provide binaries via volumes (#417) This is a small step towards making the running of PWD more efficient. Building the parts of PWD outside of a container is always going to be far more efficient than inside (and saves mapping of caches etc). As a later step we could move entirely to this approach and use a smaller image for running PWD. --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 71a20d5..f083cba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,7 @@ services: # use the latest golang image image: golang # go to the right place and starts the app - command: /bin/sh -c 'ssh-keygen -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key >/dev/null; cd /go/src/; go run api.go -save /pwd/sessions -name l2' + command: /bin/sh -c 'ssh-keygen -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key >/dev/null; cd /go/src/; if [ -e /runbin/pwd ]; then /runbin/pwd -save /pwd/sessions -name l2; else go run api.go -save /pwd/sessions -name l2; fi' volumes: # since this app creates networks and launches containers, we need to talk to docker daemon - /var/run/docker.sock:/var/run/docker.sock @@ -26,7 +26,7 @@ services: # use the latest golang image image: golang # go to the right place and starts the app - command: /bin/sh -c 'ssh-keygen -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key >/dev/null; cd /go/src/router/l2; go run l2.go -ssh_key_path /etc/ssh/ssh_host_rsa_key -name l2 -save /pwd/networks' + command: /bin/sh -c 'ssh-keygen -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key >/dev/null; cd /go/src/router/l2; if [ -e /runbin/l2 ]; then /runbin/l2 -ssh_key_path /etc/ssh/ssh_host_rsa_key -name l2 -save /pwd/networks; else go run l2.go -ssh_key_path /etc/ssh/ssh_host_rsa_key -name l2 -save /pwd/networks; fi' volumes: - /var/run/docker.sock:/var/run/docker.sock - $PWD:/go/src