-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
68 lines (58 loc) · 1.84 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
# syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-alpine:edge as buildstage
ARG CELLS_RELEASE
ENV \
HOME="/config" \
CELLS_WORKING_DIR="/config" \
GOPATH="/tmp"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
build-base \
go \
openssl && \
echo "**** fetch source code ****" && \
mkdir -p \
/tmp/src/github.com/pydio/cells && \
if [ -z ${CELLS_RELEASE+x} ]; then \
CELLS_RELEASE=$(curl -sX GET "https://api.github.com/repos/pydio/cells/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/cells-src.tar.gz -L \
https://github.com/pydio/cells/archive/${CELLS_RELEASE}.tar.gz && \
tar xf \
/tmp/cells-src.tar.gz -C \
/tmp/src/github.com/pydio/cells --strip-components=1 && \
echo "**** compile cells ****" && \
cd /tmp/src/github.com/pydio/cells && \
GOARCH=amd64 GOOS=linux go build -trimpath \
-ldflags "\
-X github.com/pydio/cells/v4/common.version=${CELLS_RELEASE:1} \
-X github.com/pydio/cells/v4/common.BuildStamp=${BUILD_DATE} \
-X github.com/pydio/cells/v4/common.BuildRevision=${VERSION}" \
-o /app/cells -x . && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
"${HOME}"/.cache \
"${HOME}"/go
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
ARG BUILD_DATE
ARG VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"
ENV \
HOME="/config" \
CELLS_WORKING_DIR="/config" \
GOPATH="/tmp" \
PATH=/app/:$PATH
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
openssl && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version
COPY --from=buildstage /app/cells /app/
COPY root/ /