2021-03-01 16:21:30 +00:00
|
|
|
#syntax=docker/dockerfile:1.2
|
2021-11-18 16:01:32 +00:00
|
|
|
FROM rust:1.56-slim-bullseye as build
|
2021-03-01 16:21:30 +00:00
|
|
|
|
2021-03-02 16:43:38 +00:00
|
|
|
# cache mounts below may already exist and owned by root
|
|
|
|
USER root
|
2021-03-01 16:21:30 +00:00
|
|
|
|
2021-11-18 16:01:32 +00:00
|
|
|
RUN apt update \
|
|
|
|
&& apt install --yes build-essential pkg-config libssl-dev clang \
|
|
|
|
&& rm -rf /var/lib/{apt,dpkg,cache,log}
|
|
|
|
|
2021-03-01 16:21:30 +00:00
|
|
|
# Build influxdb_iox
|
|
|
|
COPY . /influxdb_iox
|
|
|
|
WORKDIR /influxdb_iox
|
2021-03-02 16:43:38 +00:00
|
|
|
|
2021-03-01 16:21:30 +00:00
|
|
|
RUN \
|
|
|
|
--mount=type=cache,id=influxdb_iox_registry,sharing=locked,target=/usr/local/cargo/registry \
|
|
|
|
--mount=type=cache,id=influxdb_iox_git,sharing=locked,target=/usr/local/cargo/git \
|
|
|
|
--mount=type=cache,id=influxdb_iox_target,sharing=locked,target=/influxdb_iox/target \
|
2021-03-02 16:43:38 +00:00
|
|
|
du -cshx /usr/local/cargo/registry /usr/local/cargo/git /influxdb_iox/target && \
|
2021-11-18 16:01:32 +00:00
|
|
|
cargo build --target-dir /influxdb_iox/target --release --no-default-features --features=aws,gcp,azure && \
|
2021-03-01 16:21:30 +00:00
|
|
|
cp /influxdb_iox/target/release/influxdb_iox /root/influxdb_iox && \
|
2021-03-02 16:43:38 +00:00
|
|
|
du -cshx /usr/local/cargo/registry /usr/local/cargo/git /influxdb_iox/target
|
2021-03-01 16:21:30 +00:00
|
|
|
|
2021-11-17 08:16:45 +00:00
|
|
|
FROM debian:bullseye-slim
|
2021-03-01 16:21:30 +00:00
|
|
|
|
2021-11-18 16:01:32 +00:00
|
|
|
RUN apt update \
|
|
|
|
&& apt install --yes libssl1.1 ca-certificates --no-install-recommends \
|
2021-03-01 16:21:30 +00:00
|
|
|
&& rm -rf /var/lib/{apt,dpkg,cache,log}
|
|
|
|
|
2021-11-18 16:01:32 +00:00
|
|
|
RUN groupadd --gid 1500 iox \
|
|
|
|
&& useradd --uid 1500 --gid iox --shell /bin/bash --create-home iox
|
2021-03-01 16:21:30 +00:00
|
|
|
|
2021-11-18 16:01:32 +00:00
|
|
|
USER iox
|
2021-03-01 16:21:30 +00:00
|
|
|
|
|
|
|
RUN mkdir ~/.influxdb_iox
|
|
|
|
RUN ls -la ~/.influxdb_iox
|
|
|
|
|
|
|
|
COPY --from=build /root/influxdb_iox /usr/bin/influxdb_iox
|
|
|
|
|
|
|
|
EXPOSE 8080 8082
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/influxdb_iox"]
|
2021-03-08 13:40:40 +00:00
|
|
|
|
2021-11-03 18:06:01 +00:00
|
|
|
CMD ["run", "database"]
|