Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement/discard env variables in alpine images #209

Merged
merged 6 commits into from Mar 19, 2018

Conversation

Projects
None yet
3 participants
@tadovas
Copy link
Member

commented Mar 16, 2018

Idea: get rid of env variables inside docker images, and start using CMD style container configuration.
Especially if our binaries support optional parameters nicely.

"--config-dir=/etc/mysterium-client", \
"--data-dir=/var/lib/mysterium-client", \
"--runtime-dir=/var/run/mysterium-client", \
"--tequilapi.address=0.0.0.0" ]

This comment has been minimized.

Copy link
@zolia

zolia Mar 16, 2018

Member

127.0.0.1 should be sufficient.

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 16, 2018

Author Member

It cannot. In case of 127.0.0.1 client binds on loopback interface inside container - it's not possible to access tequilapi. Tested on e2e :)

--config-dir=$OS_DIR_CONFIG \
--data-dir=$OS_DIR_DATA \
--runtime-dir=$OS_DIR_RUN \
--tequilapi.address=0.0.0.0 \

This comment has been minimized.

Copy link
@zolia

zolia Mar 16, 2018

Member

same here

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 16, 2018

Author Member

Check comment above

COPY bin/client_docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
# Directories
RUN mkdir -p /etc/mysterium-client \

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 16, 2018

Member

This one is created by COPY bin/client_package/config /etc/mysterium-client

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 19, 2018

Author Member

Fixed


WORKDIR /var/run/mysterium-client

ENTRYPOINT [ "/usr/bin/mysterium_client", \

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 16, 2018

Member

Dont install bash anymore in both Alpine images

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 19, 2018

Author Member

Unfortunately our update-resolv-conf script is using bash, so we cannot get rid of bash until script is rewritten

--config-dir=$OS_DIR_CONFIG \
--data-dir=$OS_DIR_DATA \
--runtime-dir=$OS_DIR_RUN \
$@

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 16, 2018

Member

What about defaults file in Debian init.d service?
bin/client_package/installation/default

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 19, 2018

Author Member

Made a common accepted style. Define DAEMON_OPTS empty var in config file, eval var in initd.sh script

--tequilapi.address=$MYSTERIUM_CLIENT_TEQUILAPI_ADDRESS \
--tequilapi.port=$MYSTERIUM_CLIENT_TEQUILAPI_PORT \
--discovery-address=$MYSTERIUM_DISCOVERY_ADDRESS \
$(DAEMON_OPTS) \

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 19, 2018

Member

${DAEMON_OPTS}

@Waldz

This comment has been minimized.

Copy link
Member

commented Mar 19, 2018

LGTM. Just need to drop environment variables in infra now

@Waldz

Waldz approved these changes Mar 19, 2018

@tadovas tadovas merged commit 4ed479e into master Mar 19, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@tadovas tadovas deleted the improvement/discard-env-variables-in-alpine-images branch Mar 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.