This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
65 lines (52 loc) · 1.92 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
ARG TESLAMATE_TAG
FROM teslamate/grafana:${TESLAMATE_TAG} as grafana
#---
FROM teslamate/teslamate:${TESLAMATE_TAG}
ARG ARCH
ARG BASHIO_VERSION=0.11.0
ARG S6_OVERLAY_VERSION=2.1.0.2
ENV \
DEBIAN_FRONTEND="noninteractive" \
LANG="C.UTF-8" \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_CMD_WAIT_FOR_SERVICES=1
USER root
# Commands taken from HA Ubuntu base Dockerfile but switched to wget as curl didn't work using buildx
# https://github.com/home-assistant/docker-base/blob/master/ubuntu/amd64/Dockerfile
RUN \
set -x \
&& apt-get update && apt-get install -y --no-install-recommends \
bash \
bind9utils \
ca-certificates \
curl \
jq \
nginx \
tzdata \
wget \
&& rm -rf /var/lib/apt/lists/* \
\
&& wget https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${ARCH}.tar.gz \
&& tar zxvf s6-overlay-${ARCH}.tar.gz -C / \
&& rm -f s6-overlay-${ARCH}.tar.gz \
&& mkdir -p /etc/fix-attrs.d \
&& mkdir -p /etc/services.d \
\
&& mkdir -p /tmp/bashio \
&& wget https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz \
&& tar xvzf v${BASHIO_VERSION}.tar.gz --strip 1 -C /tmp/bashio \
&& rm -f v${BASHIO_VERSION}.tar.gz \
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
&& rm -rf /tmp/bashio
COPY --chown=root scripts/*.sh /
RUN chmod a+x /*.sh
COPY --chown=root services/teslamate/run services/teslamate/finish /etc/services.d/teslamate/
RUN chmod a+x /etc/services.d/teslamate/*
COPY --chown=root services/nginx/run services/nginx/finish /etc/services.d/nginx/
RUN chmod a+x /etc/services.d/nginx/*
COPY --chown=root services/nginx/teslamate.conf /etc/nginx/conf.d/
COPY --from=grafana --chown=root /dashboards /dashboards
COPY --from=grafana --chown=root /dashboards_internal /dashboards
# S6-Overlay
ENTRYPOINT ["/init"]