chore: allow image server mode to be chosen via env var

pull/24376/head
Marco Neumann 2021-11-12 09:55:40 +01:00
parent 5247fee979
commit 053afac5e9
2 changed files with 17 additions and 4 deletions

View File

@ -4,7 +4,7 @@
FROM debian:buster-slim FROM debian:buster-slim
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y libssl1.1 libgcc1 libc6 ca-certificates --no-install-recommends \ && apt-get install -y libssl1.1 libgcc1 libc6 ca-certificates gettext-base --no-install-recommends \
&& rm -rf /var/lib/{apt,dpkg,cache,log} && rm -rf /var/lib/{apt,dpkg,cache,log}
RUN groupadd -g 1500 rust \ RUN groupadd -g 1500 rust \
@ -15,10 +15,13 @@ USER rust
RUN mkdir ~/.influxdb_iox RUN mkdir ~/.influxdb_iox
RUN ls -la ~/.influxdb_iox RUN ls -la ~/.influxdb_iox
ENV INFLUXDB_IOX_SERVER_MODE=database
COPY docker/entrypoint.sh /usr/bin/entrypoint.sh
COPY target/release/influxdb_iox /usr/bin/influxdb_iox COPY target/release/influxdb_iox /usr/bin/influxdb_iox
EXPOSE 8080 8082 EXPOSE 8080 8082
ENTRYPOINT ["influxdb_iox"] ENTRYPOINT ["/usr/bin/entrypoint.sh"]
CMD ["run", "database"] CMD ["run", "$INFLUXDB_IOX_SERVER_MODE"]

10
docker/entrypoint.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -eu -o pipefail
args=( "$@" )
for i in "${!args[@]}"; do
args[$i]="$(echo "${args[$i]}" | envsubst)"
done
exec influxdb_iox "${args[@]}"