influxdb/docker/Dockerfile.ci

50 lines
1.4 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 actual image used for CI pipeline
FROM rust:slim-buster
# 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 \
--no-install-recommends \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}
# 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 rustup toolchain install nightly-2020-11-19
RUN rustup component add rustfmt clippy --toolchain nightly-2020-11-19
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"]