This repository has been archived by the owner on Feb 12, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
68 lines (58 loc) · 1.67 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
66
67
68
FROM lsiobase/alpine:3.7 as buildstage
############## build stage ##############
# currently cardigann doesn't build correctly using go 1.10
# hence using alpine 3.7 for build stage
# build variables
ARG GOPATH=/tmp/golang
ARG CARDIGANN_RELEASE
ARG CARDIGANN_DIR=$GOPATH/src/github.com/cardigann/cardigann
RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
g++ \
gcc \
git \
go \
make \
nodejs-npm \
curl
RUN \
echo "**** fetch source code and nvm ****" && \
if [ -z ${CARDIGANN_RELEASE+x} ]; then \
CARDIGANN_RELEASE=$(curl -sX GET "https://api.github.com/repos/cardigann/cardigann/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
git clone https://github.com/cardigann/cardigann.git ${CARDIGANN_DIR} && \
git clone https://github.com/creationix/nvm.git /root/.nvm && \
git -C $CARDIGANN_DIR checkout ${CARDIGANN_RELEASE}
RUN \
echo "**** install node packages ****" && \
cd ${CARDIGANN_DIR}/web && \
npm install
RUN \
echo "**** compile cardigann ****" && \
cd ${CARDIGANN_DIR} && \
export PATH=$GOPATH/bin:$PATH && \
make setup && \
make test && \
make build && \
make install
############## runtime stage ##############
FROM lsiobase/alpine:3.8
# set version label
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="sparklyballs"
# environment variables
ENV CONFIG_DIR=/config
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
ca-certificates
# copy files from build stage and local files
COPY --from=buildstage /tmp/golang/bin/cardigann /usr/bin/cardigann
COPY root/ /
# ports and volumes
EXPOSE 5060
VOLUME /config