influxdb/docker/Dockerfile.ci

62 lines
2.2 KiB
Docker

###
# Dockerfile for the image used in the InfluxDB IOx CI tests
# As of October 2020, it is rebuilt each night
#
# It expects to be run with the repo checked out locally.
# for example:
#
# cd influxdb_iox
# docker build -f docker/Dockerfile.ci --build-arg RUST_VERSION=$(cat rust-toolchain) .
##
ARG RUST_VERSION
# Build actual image used for CI pipeline
FROM rust:${RUST_VERSION}-slim-buster
RUN rustup component add rustfmt clippy
# make Apt non-interactive
RUN echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90ci \
&& echo 'DPkg::Options "--force-confnew";' >> /etc/apt/apt.conf.d/90ci
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& mkdir -p /usr/share/man/man1 \
&& apt-get install -y \
git locales sudo openssh-client ca-certificates tar gzip parallel \
unzip zip bzip2 gnupg curl make pkg-config libssl-dev \
jq clang lld g++ \
--no-install-recommends \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}
# Install bazel using the binary installer to enable building of flatc in the flatbuffers check
RUN curl -Lo bazel-4.0.0-installer-linux-x86_64.sh https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-installer-linux-x86_64.sh \
&& chmod +x bazel-4.0.0-installer-linux-x86_64.sh \
&& ./bazel-4.0.0-installer-linux-x86_64.sh \
&& rm bazel-4.0.0-installer-linux-x86_64.sh
# Install InfluxDB 2.0 OSS to enable integration tests of the influxdb2_client crate
RUN curl -o influxdb2.tar.gz https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.4-linux-amd64.tar.gz \
&& tar xvzf influxdb2.tar.gz \
&& sudo cp influxdb2-2.0.4-linux-amd64/influxd /usr/local/bin/ \
&& rm -rf influxdb2-2.0.4-linux-amd64
# Set timezone to UTC by default
RUN ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
# Use unicode
RUN locale-gen C.UTF-8 || true
ENV LANG=C.UTF-8
RUN groupadd -g 1500 rust \
&& useradd -u 1500 -g rust -s /bin/bash -m rust \
&& echo 'rust ALL=NOPASSWD: ALL' >> /etc/sudoers.d/10-rust \
&& echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
USER rust
ENV PATH /home/rust/.local/bin:/home/rust/bin:${PATH}
CMD ["/bin/bash"]