-
Notifications
You must be signed in to change notification settings - Fork 68
/
Dockerfile
38 lines (28 loc) · 1.16 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
FROM python:3.10
ENV PROTOC_VERSION 3.19.6
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "amd64" ]; then \
arch="x86_64"; \
elif [ "$TARGETARCH" = "arm64" ]; then \
arch="aarch_64"; \
else \
exit 1; \
fi \
&& curl -o /tmp/protoc.zip -L \
https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${arch}.zip \
&& unzip /tmp/protoc.zip -d /usr -x readme.txt \
&& rm /tmp/protoc.zip
RUN useradd -ms /bin/bash esphome
USER esphome
WORKDIR /aioesphomeapi
COPY requirements_test.txt ./
RUN pip3 install -r requirements_test.txt
CMD ["script/gen-protoc"]
LABEL \
org.opencontainers.image.title="aioesphomeapi protobuf generator" \
org.opencontainers.image.description="An image to help with ESPHomes aioesphomeapi protobuf generation" \
org.opencontainers.image.vendor="ESPHome" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://esphome.io" \
org.opencontainers.image.source="https://github.com/esphome/aioesphomeapi" \
org.opencontainers.image.documentation="https://github.com/esphome/aioesphomeapi/blob/main/README.md"