Skip to content

Commit 8f27671

Browse files
authored
Add "regular" influxdb2 image, with test cases (#445)
1 parent 52a8954 commit 8f27671

File tree

10 files changed

+893
-3
lines changed

10 files changed

+893
-3
lines changed

.circleci/config.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1-
version: 2
1+
version: 2.1
2+
3+
workflows:
4+
version: 2
5+
ci:
6+
jobs:
7+
- build
8+
- test-influxdb
9+
210
jobs:
311
build:
412
docker:
5-
- image: circleci/golang:1.11
6-
working_directory: /go/src/github.com/influxdata/influxdata-docker
13+
- image: cimg/go:1.15.6
714
steps:
815
- checkout
916
- setup_remote_docker
1017
- run: bash circle-test.sh
18+
19+
test-influxdb:
20+
machine: true
21+
steps:
22+
- checkout
23+
- run: sudo apt-get update && sudo apt-get install -y jq
24+
- run: bash influxdb/test/test-2x-e2e.sh
25+
- store_artifacts:
26+
path: influxdb/test/logs
27+
destination: container-logs

influxdb/2.0/Dockerfile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
FROM buildpack-deps:buster-curl
2+
3+
RUN groupadd -r influxdb --gid=1000 && \
4+
useradd -r -g influxdb --uid=1000 --home-dir=/home/influxdb --shell=/bin/bash influxdb && \
5+
mkdir -p /home/influxdb && \
6+
chown -R influxdb:influxdb /home/influxdb
7+
8+
# Install gosu for easy step-down from root.
9+
# https://github.com/tianon/gosu/releases
10+
ENV GOSU_VER 1.12
11+
RUN set -eux; \
12+
dpkgArch="$(dpkg --print-architecture)" && \
13+
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-$dpkgArch" && \
14+
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-$dpkgArch.asc" && \
15+
export GNUPGHOME="$(mktemp -d)" && \
16+
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && \
17+
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \
18+
gpgconf --kill all && \
19+
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc && \
20+
chmod +x /usr/local/bin/gosu && \
21+
gosu --version && \
22+
gosu nobody true
23+
24+
ENV INFLUXDB_VERSION 2.0.4
25+
# TODO: Update this to use a 'real' release.
26+
RUN set -eux && \
27+
ARCH= && dpkgArch="$(dpkg --print-architecture)" && \
28+
case "${dpkgArch##*-}" in \
29+
amd64) ARCH='amd64';; \
30+
arm64) ARCH='arm64';; \
31+
*) echo "Unsupported architecture: ${dpkgArch}"; exit 1;; \
32+
esac && \
33+
wget --no-verbose https://dl.influxdata.com/platform/nightlies/influxdb2_nightly_linux_${ARCH}.tar.gz.asc && \
34+
wget --no-verbose https://dl.influxdata.com/platform/nightlies/influxdb2_nightly_linux_${ARCH}.tar.gz && \
35+
export GNUPGHOME="$(mktemp -d)" && \
36+
echo "disable-ipv6" >> $GNUPGHOME/dirmngr.conf && \
37+
gpg --keyserver keys.openpgp.org --recv-keys 8C2D403D3C3BDB81A4C27C883C3E4B7317FFE40A && \
38+
gpg --batch --verify influxdb2_nightly_linux_${ARCH}.tar.gz.asc influxdb2_nightly_linux_${ARCH}.tar.gz && \
39+
tar xzf influxdb2_nightly_linux_${ARCH}.tar.gz && \
40+
cp influxdb2_nightly_linux_${ARCH}/influx* /usr/local/bin/ && \
41+
rm -rf "$GNUPGHOME" influxdb2.key influxdb2_nightly_${ARCH}* && \
42+
influxd version && \
43+
influx version
44+
45+
# Create standard directories expected by the entry-point.
46+
RUN mkdir /docker-entrypoint-initdb.d && \
47+
mkdir -p /var/lib/influxdb2 && \
48+
chown -R influxdb:influxdb /var/lib/influxdb2 && \
49+
mkdir -p /etc/influxdb2 && \
50+
chown -R influxdb:influxdb /etc/influxdb2
51+
VOLUME /var/lib/influxdb2 /etc/influxdb2
52+
53+
COPY default-config.yml /etc/defaults/influxdb2/config.yml
54+
COPY entrypoint.sh /entrypoint.sh
55+
56+
ENTRYPOINT ["/entrypoint.sh"]
57+
CMD ["influxd"]
58+
59+
EXPOSE 8086
60+
61+
ENV INFLUX_CONFIGS_PATH /etc/influxdb2/influx-configs
62+
ENV INFLUXD_INIT_PORT 9999

influxdb/2.0/default-config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bolt-path: /var/lib/influxdb2/influxd.bolt
2+
engine-path: /var/lib/influxdb2/engine
3+
nats-port: 4222

0 commit comments

Comments
 (0)