-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
46 lines (38 loc) · 1.06 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
FROM python:2.7.13-alpine
RUN apk add --no-cache \
ca-certificates
ENV DOCKER_CHANNEL stable
ENV DOCKER_VERSION 17.06.1-ce
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
curl \
tar \
; \
\
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
x86_64) dockerArch='x86_64' ;; \
s390x) dockerArch='s390x' ;; \
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
esac; \
\
if ! curl -fL -o docker.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-${DOCKER_VERSION}.tgz"; then \
echo >&2 "error: failed to download 'docker-${DOCKER_VERSION}' from '${DOCKER_CHANNEL}' for '${dockerArch}'"; \
exit 1; \
fi; \
\
tar --extract \
--file docker.tgz \
--strip-components 1 \
--directory /usr/local/bin/ \
; \
rm docker.tgz; \
\
apk del .fetch-deps; \
\
dockerd -v; \
docker -v
COPY app /opt/docker-service-replicas-exporter
RUN pip install -r /opt/docker-service-replicas-exporter/requirements.txt
EXPOSE 9258
ENTRYPOINT ["python", "/opt/docker-service-replicas-exporter/exporter.py"]