2018-03-12 15:29:13 +05:30
|
|
|
|
|
|
|
###################################
|
|
|
|
#Build stage
|
|
|
|
FROM golang:1.10-alpine3.7 AS build-env
|
|
|
|
|
|
|
|
ARG GITEA_VERSION
|
|
|
|
ARG TAGS="sqlite"
|
|
|
|
ENV TAGS "bindata $TAGS"
|
|
|
|
|
|
|
|
#Build deps
|
|
|
|
RUN apk --no-cache add build-base git
|
|
|
|
|
|
|
|
#Setup repo
|
|
|
|
COPY . ${GOPATH}/src/code.gitea.io/gitea
|
|
|
|
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
|
|
|
|
|
|
|
|
#Checkout version if set
|
|
|
|
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
|
|
|
|
&& make clean generate build
|
|
|
|
|
2017-12-10 08:20:50 +05:30
|
|
|
FROM alpine:3.7
|
2018-03-12 15:29:13 +05:30
|
|
|
LABEL maintainer="maintainers@gitea.io"
|
2015-08-25 10:11:01 +05:30
|
|
|
|
2016-11-28 18:43:18 +05:30
|
|
|
EXPOSE 22 3000
|
2015-08-25 10:11:01 +05:30
|
|
|
|
2017-05-08 16:39:20 +05:30
|
|
|
RUN apk --no-cache add \
|
2016-11-28 18:43:18 +05:30
|
|
|
bash \
|
2018-03-12 15:29:13 +05:30
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gettext \
|
2016-11-28 18:43:18 +05:30
|
|
|
git \
|
|
|
|
linux-pam \
|
|
|
|
openssh \
|
2018-03-12 15:29:13 +05:30
|
|
|
s6 \
|
|
|
|
sqlite \
|
|
|
|
su-exec \
|
2017-06-30 11:40:37 +05:30
|
|
|
tzdata
|
2018-03-12 15:29:13 +05:30
|
|
|
|
2017-06-30 11:40:37 +05:30
|
|
|
RUN addgroup \
|
2016-11-28 22:07:31 +05:30
|
|
|
-S -g 1000 \
|
2016-11-28 18:43:18 +05:30
|
|
|
git && \
|
2016-11-28 21:52:22 +05:30
|
|
|
adduser \
|
|
|
|
-S -H -D \
|
|
|
|
-h /data/git \
|
2016-11-28 18:43:18 +05:30
|
|
|
-s /bin/bash \
|
|
|
|
-u 1000 \
|
2016-11-28 21:52:22 +05:30
|
|
|
-G git \
|
2016-12-15 14:46:55 +05:30
|
|
|
git && \
|
2017-08-13 11:48:05 +05:30
|
|
|
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
|
2015-08-17 12:40:23 +05:30
|
|
|
|
2017-06-30 11:40:37 +05:30
|
|
|
ENV USER git
|
|
|
|
ENV GITEA_CUSTOM /data/gitea
|
2016-01-25 18:37:37 +05:30
|
|
|
|
2015-10-02 15:26:36 +05:30
|
|
|
VOLUME ["/data"]
|
2016-11-28 18:43:18 +05:30
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/entrypoint"]
|
|
|
|
CMD ["/bin/s6-svscan", "/etc/s6"]
|
|
|
|
|
|
|
|
COPY docker /
|
2018-03-12 15:29:13 +05:30
|
|
|
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
|