Skip to content

Instantly share code, notes, and snippets.

@ep1cman
Last active May 22, 2021 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ep1cman/5a51af73cba19a104523286167f29869 to your computer and use it in GitHub Desktop.
Save ep1cman/5a51af73cba19a104523286167f29869 to your computer and use it in GitHub Desktop.
influxdb 2.0 with telegram
FROM ubuntu:20.04 AS dbuild
ENV DEBIAN_FRONTEND noninteractive
# Needed for Yarn steps to veryify the keys
RUN apt update
RUN apt install --yes curl gnupg2
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
# Now update index with Yarn
RUN apt update
RUN apt install --yes \
cargo \
git \
golang \
libclang-dev \
llvm-dev \
make \
nodejs \
protobuf-compiler \
ragel \
rustc \
yarn
FROM dbuild AS dshell
ARG USERID=1000
RUN adduser --quiet --home /code --uid ${USERID} --disabled-password --gecos "" influx
USER influx
ENTRYPOINT [ "/bin/bash" ]
FROM dbuild AS dbuild-all
COPY . /code
WORKDIR /code
# Enable missing UI elements and fix makefile
RUN rm -rf ui && git clone https://github.com/influxdata/ui.git
RUN sed -i "s/'notification-endpoint-telegram': false,/'notification-endpoint-telegram': true,/g" ui/src/shared/selectors/flags.ts && \
sed -i "s/scripts\/fetch-ui-assets.sh/yarn --cwd ui build/g" Makefile
RUN make
##
# InfluxDB Image (Monolith)
##
FROM debian:stretch-slim AS influx
COPY --from=dbuild-all /code/bin/linux/influxd /usr/bin/influxd
COPY --from=dbuild-all /code/bin/linux/influx /usr/bin/influx
# Get latest CA certificates to allow telegram api to work
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates --fresh
EXPOSE 8086
ENTRYPOINT [ "/usr/bin/influxd" ]
##
# InfluxDB UI Image
##
FROM nginx:alpine AS ui
EXPOSE 80
COPY --from=dbuild-all /code/ui/build /usr/share/nginx/html
@mnsmithuk
Copy link

Hi,

I couldn't get this Dockerfile to work. It looks like they have changed the code since you have created this Dockerfile.

@ep1cman
Copy link
Author

ep1cman commented May 21, 2021

Looks like they

  1. Removed the UI code from the main repo, its now in its own
  2. Removed some of the flags, but telegram is still there
  3. Changed the way the Makefile works.
    I will look into updating the above to work again with this second UI repo

@ep1cman
Copy link
Author

ep1cman commented May 21, 2021

Hi,

I couldn't get this Dockerfile to work. It looks like they have changed the code since you have created this Dockerfile.

Please try it now, you will need to clone the influx git repo and replace the dockerfile with the above then run:

docker build --target influx -t influxdb .
docker run --name influx  -p 8086:8086 influxdb

@mnsmithuk
Copy link

Thanks for a quick turnaround. I tried it. It builds ok but after the initial setup it logs you out and for some reason the credentials don't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment