PhysarumSM / service-registry

Apache License 2.0
0 stars 0 forks source link

Add fields in image config file to pass arguments to proxy (psk, key file) #17

Closed hivanco closed 4 years ago

t-lin commented 4 years ago

@hivanco The lifecycle agent, as of Multi-Tier-Cloud/service-manager@73c8ee0663e407159064e8d0436b87b07dd0f9dd, passes environment variables for bootstraps and PSK to the proxies. To enable their use, simply add the following two lines to Dockerfile template:

ENV P2P_BOOTSTRAPS=
ENV P2P_PSK=

Side note: I've been using Alpine as my base to build the containers, and they're much smaller than Ubuntu (< 50 MB). It requires using a symbolic link to "trick" binaries compiled against glibc to use musl. I've read some posts about corner cases of musl not being 100% compatible, but I haven't ran into any issues yet. Give it a try for your test images if you'd like.

FROM alpine:latest

... some stuff here (workdir, copy base files, env) ...
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

... any img-specific stuff ...