-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (39 loc) · 1.03 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
FROM resin/raspberrypi3-alpine-python:3.6-slim
MAINTAINER loganavatar
# set version label
ARG BUILD_DATE
ARG VERSION
ARG GIT_URL='https://github.com/JonnyWong16/plexpy'
ARG GIT_BRANCH=master
LABEL build_version="bristle.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
# install packages
RUN \
apk add --no-cache --virtual=build-dependencies \
g++ \
gcc \
make \
git \
python-dev && \
# install pycryptodomex
pip install --no-cache-dir -U \
pycryptodomex && \
# check to see if branch exists
remotecheck=$(git ls-remote --heads $GIT_URL $GIT_BRANCH | wc -l) && \
# install app
if [ $remotecheck = 0 ]; then \
echo "Bad branch name, $GIT_BRANCH, cloning master instead." && \
git clone --branch master --depth 1 $GIT_URL /app/plexpy; \
else \
echo "Cloning $GIT_BRANCH" && \
git clone --branch $GIT_BRANCH --depth 1 $GIT_URL /app/plexpy; \
fi && \
# cleanup
apk del --purge \
build-dependencies && \
rm -rf \
/root/.cache
# add local files
COPY root/ /
# ports and volumes
VOLUME /config /logs
EXPOSE 8181