From 8152ee754dda1598d241b39c1c12a786462c1b1b Mon Sep 17 00:00:00 2001 From: Eric Malloy Date: Tue, 26 Feb 2019 14:06:54 -0500 Subject: [PATCH] add MCROUTER_LISTEN_PORT as Dockerfile ENV explicitly list and COPY files into the docker image fs --- .../scripts/docker/Dockerfile.ubuntu-packaged | 18 +++++++++++++++++- .../apt/sources.list.d => }/10-mcrouter.list | 0 .../{usr/local/bin => }/entrypoint.sh | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) rename mcrouter/scripts/docker/container/ubuntu-packaged/{etc/apt/sources.list.d => }/10-mcrouter.list (100%) rename mcrouter/scripts/docker/container/ubuntu-packaged/{usr/local/bin => }/entrypoint.sh (87%) diff --git a/mcrouter/scripts/docker/Dockerfile.ubuntu-packaged b/mcrouter/scripts/docker/Dockerfile.ubuntu-packaged index 5eb940f9e..ac02b584e 100644 --- a/mcrouter/scripts/docker/Dockerfile.ubuntu-packaged +++ b/mcrouter/scripts/docker/Dockerfile.ubuntu-packaged @@ -8,7 +8,20 @@ RUN set -xe \ apt-get update \ && apt-get install -y $buildDeps -COPY ["container/ubuntu-packaged/", "/"] + +COPY ["container/ubuntu-packaged/entrypoint.sh", \ + "/usr/local/bin/" \ + ] + +COPY ["container/ubuntu-packaged/10-mcrouter.list", \ + "/etc/apt/sources.list.d/" \ + ] + +COPY ["container/ubuntu-packaged/mcrouter.json", \ + "/etc/mcrouter/" \ + ] + + RUN wget -qO- \ https://facebook.github.io/mcrouter/debrepo/xenial/PUBLIC.KEY \ @@ -20,4 +33,7 @@ RUN wget -qO- \ && apt-get purge -y --autoremove -o APT::AutoRemove::RecommendsImportant=false wget apt-transport-https \ && apt-get autoremove && apt-get autoclean && rm -rf /var/lib/apt-lists/* + +ENV MCROUTER_LISTEN_PORT 5000 + ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/mcrouter/scripts/docker/container/ubuntu-packaged/etc/apt/sources.list.d/10-mcrouter.list b/mcrouter/scripts/docker/container/ubuntu-packaged/10-mcrouter.list similarity index 100% rename from mcrouter/scripts/docker/container/ubuntu-packaged/etc/apt/sources.list.d/10-mcrouter.list rename to mcrouter/scripts/docker/container/ubuntu-packaged/10-mcrouter.list diff --git a/mcrouter/scripts/docker/container/ubuntu-packaged/usr/local/bin/entrypoint.sh b/mcrouter/scripts/docker/container/ubuntu-packaged/entrypoint.sh similarity index 87% rename from mcrouter/scripts/docker/container/ubuntu-packaged/usr/local/bin/entrypoint.sh rename to mcrouter/scripts/docker/container/ubuntu-packaged/entrypoint.sh index f430fbc36..ff847c712 100755 --- a/mcrouter/scripts/docker/container/ubuntu-packaged/usr/local/bin/entrypoint.sh +++ b/mcrouter/scripts/docker/container/ubuntu-packaged/entrypoint.sh @@ -6,7 +6,8 @@ function run_mcrouter() { local CONFIG_PATH=$1 mcrouter \ --config file:${CONFIG_PATH} \ - -p "${MCROUTER_LISTEN_PORT:-5000}" + -p "${MCROUTER_LISTEN_PORT:-5000}" \ + "$@" }