Skip to content

Commit

Permalink
Provide docker image for redis aggregator (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Terkwood authored Nov 20, 2018
1 parent ffb0990 commit 98f2abb
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 40 deletions.
5 changes: 0 additions & 5 deletions local_images/.gitignore

This file was deleted.

22 changes: 15 additions & 7 deletions local_images/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
version: '3'
services:
redis_aggregator:
build: redis_aggregator/.
volumes:
- "/var/volumes/redis_aggregator_volume:/data"
depends_on:
- "redis"
command: ["./wait-for-it.sh", "redis:36379", "--", "redis_aggregator"]
grafana:
image: "fg2it/grafana-armhf:v5.1.4"
ports:
- "3000:3000"
volumes:
- "$PWD/grafana_volume/etc/grafana:/etc/grafana"
- "$PWD/grafana_volume/var/lib/grafana:/var/lib/grafana"
- "/var/volumes/grafana_volume/etc/grafana:/etc/grafana"
- "/var/volumes/grafana_volume/var/lib/grafana:/var/lib/grafana"
redis:
image: "arm32v7/redis"
ports:
- "36379:6379"
volumes:
- "$PWD/redis_volume:/data"
- "/var/volumes/redis_volume:/data"
mosquitto:
build: mosquitto/.
ports:
- "1883:1883"
- "8883:8883"
- "1883:1883"
- "8883:8883"
telegraf:
image: "telegraf:1.6"
volumes:
- "$PWD/telegraf_volume/telegraf.conf:/etc/telegraf/telegraf.conf:ro"
- "/var/volumes/telegraf_volume/telegraf.conf:/etc/telegraf/telegraf.conf:ro"
influxdb:
image: "influxdb:latest"
ports:
- "8086:8086"
volumes:
- "$PWD/influxdb_volume:/var/lib/influxdb"
- "/var/volumes/influxdb_volume:/var/lib/influxdb"

5 changes: 5 additions & 0 deletions local_images/led_status_helper/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM prawnalith/local/rust
RUN git clone https://github.com/Terkwood/prawnalith.git
WORKDIR "/prawnalith/services/led_status_helper"
RUN cargo build --release
ENTRYPOINT tail -f /dev/null
13 changes: 13 additions & 0 deletions local_images/redis_aggregator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM prawnalith/local/rust

RUN apt-get install -y pkg-config libssl-dev

WORKDIR /prawnalith/services/redis_aggregator

RUN cargo build --release

RUN cargo install --path .

WORKDIR /data

ENTRYPOINT [ "redis_aggregator" ]
29 changes: 1 addition & 28 deletions local_images/rocket/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
FROM prawnalith/local/base
FROM prawnalith/local/rust

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.29.0

RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='f69dafcca62fe70d7882113e21bb96a2cbdf4fc4636d25337d6de9191bdec8da' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='eee969b9fd128e8dc9b4ec44acde46735cf8e612d06495e9d022517849aba2d6' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='cdc48b7882582fd8475107a406dd86df85c7d72e5deea99ff8940c8e11531285' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='3bad3945452509ac28ba4113e198323daab57488d6885bb31ac30c9eecd88825' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.13.0/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;

RUN apt-get install -y git
RUN git clone https://github.com/SergioBenitez/Rocket
WORKDIR "/Rocket"
RUN git checkout v0.3.16
WORKDIR "/Rocket/examples/hello_world"
Expand Down
33 changes: 33 additions & 0 deletions local_images/rust/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM prawnalith/local/base

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.30.1

RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='f69dafcca62fe70d7882113e21bb96a2cbdf4fc4636d25337d6de9191bdec8da' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='eee969b9fd128e8dc9b4ec44acde46735cf8e612d06495e9d022517849aba2d6' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='cdc48b7882582fd8475107a406dd86df85c7d72e5deea99ff8940c8e11531285' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='3bad3945452509ac28ba4113e198323daab57488d6885bb31ac30c9eecd88825' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.13.0/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;

RUN rustup default nightly
RUN rustup update

RUN git clone https://github.com/Terkwood/prawnalith

ENTRYPOINT tail -f /dev/null
3 changes: 3 additions & 0 deletions local_images/rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Rust Raspberry Pi Dockerfile

This is a Dockerfile which installs rust-lang on a Raspberry Pi.
File renamed without changes.

0 comments on commit 98f2abb

Please sign in to comment.