forked from kapdap/docker-gitea-rpi
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile.x86
93 lines (71 loc) · 2.4 KB
/
Dockerfile.x86
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#
# Build environment-to-ini
#
FROM balenalib/armv7hf-alpine-golang:latest-build AS builder
ARG VERSION
ENV TAGS "bindata timetzdata sqlite sqlite_unlock_notify"
ENV GOARCH arm
RUN [ "cross-build-start" ]
RUN apk --no-cache add build-base git nodejs npm curl
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
## GET GITEA-DOCKER FILES
RUN curl -fSL https://github.com/go-gitea/gitea/archive/v$VERSION.tar.gz | \
tar xz gitea-$VERSION/ --strip-components=1
# Begin env-to-ini build
RUN go build -ldflags="-extldflags=-static" contrib/environment-to-ini/environment-to-ini.go
RUN [ "cross-build-end" ]
#
# Build runtime image
#
FROM balenalib/armv7hf-alpine:latest
EXPOSE 22 3000
ENV USER git
ENV GITEA_CUSTOM /data/gitea
ENV GODEBUG=netdns=go
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entry.sh", "/usr/bin/entrypoint"]
CMD ["/bin/s6-svscan", "/etc/s6"]
RUN [ "cross-build-start" ]
RUN install_packages \
su-exec \
ca-certificates \
sqlite \
bash \
git \
linux-pam \
s6 \
curl \
gettext \
openssh \
tzdata \
gnupg
RUN addgroup \
-S -g 1000 \
git && \
adduser \
-S -H -D \
-h /data/git \
-s /bin/bash \
-u 1000 \
-G git \
git && \
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
## GITEA RELEASE VERSION
ARG VERSION=1.15.2
LABEL org.opencontainers.image.title="Gitea" \
org.opencontainers.image.description="Gitea in a container for ARM" \
org.opencontainers.image.source="https://github.com/watson81/docker-gitea-rpi" \
org.opencontainers.image.url="https://github.com/watson81/docker-gitea-rpi" \
org.opencontainers.image.licenses="( GPL-3.0 AND MIT )" \
org.opencontainers.image.version="$VERSION"
RUN apk upgrade --no-cache
COPY --from=builder /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
## GET GITEA-DOCKER FILES
RUN curl -fSL https://github.com/go-gitea/gitea/archive/v$VERSION.tar.gz | \
tar xz gitea-$VERSION/docker/root --strip-components=3
## GET GITEA
RUN mkdir -p /app/gitea && \
curl -fSLo /app/gitea/gitea https://github.com/go-gitea/gitea/releases/download/v$VERSION/gitea-$VERSION-linux-arm-6 && \
chmod 0755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini && \
chmod 0755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
RUN [ "cross-build-end" ]