File tree 3 files changed +34
-15
lines changed
3 files changed +34
-15
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+
2
+ # ##################################
3
+ # Build stage
4
+ FROM golang:1.10-alpine3.7 AS build-env
5
+
6
+ ARG GITEA_VERSION
7
+ ARG TAGS="sqlite"
8
+ ENV TAGS "bindata $TAGS"
9
+
10
+ # Build deps
11
+ RUN apk --no-cache add build-base git
12
+
13
+ # Setup repo
14
+ COPY . ${GOPATH}/src/code.gitea.io/gitea
15
+ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
16
+
17
+ # Checkout version if set
18
+ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}" ; fi \
19
+ && make clean generate build
20
+
1
21
FROM alpine:3.7
2
- LABEL maintainer="The Gitea Authors "
22
+ LABEL maintainer=
"[email protected] "
3
23
4
24
EXPOSE 22 3000
5
25
6
26
RUN apk --no-cache add \
7
- su-exec \
8
- ca-certificates \
9
- sqlite \
10
27
bash \
28
+ ca-certificates \
29
+ curl \
30
+ gettext \
11
31
git \
12
32
linux-pam \
13
- s6 \
14
- curl \
15
33
openssh \
16
- gettext \
34
+ s6 \
35
+ sqlite \
36
+ su-exec \
17
37
tzdata
38
+
18
39
RUN addgroup \
19
40
-S -g 1000 \
20
41
git && \
@@ -29,12 +50,11 @@ RUN addgroup \
29
50
30
51
ENV USER git
31
52
ENV GITEA_CUSTOM /data/gitea
32
- ENV GODEBUG=netdns=go
33
53
34
54
VOLUME ["/data" ]
35
55
36
56
ENTRYPOINT ["/usr/bin/entrypoint" ]
37
57
CMD ["/bin/s6-svscan" , "/etc/s6" ]
38
58
39
59
COPY docker /
40
- COPY gitea /app/gitea/gitea
60
+ COPY --from=build-env /go/src/code.gitea.io/gitea/ gitea /app/gitea/gitea
Original file line number Diff line number Diff line change @@ -7,5 +7,9 @@ DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
7
7
8
8
.PHONY : docker
9
9
docker :
10
- docker run -ti --rm -v $(CURDIR ) :/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS=" bindata $( TAGS) " webhippie/golang:edge make clean generate build
11
10
docker build --disable-content-trust=false -t $(DOCKER_REF ) .
11
+ # support also build args docker build --build-arg GITEA_VERSION=v1.2.3 --build-arg TAGS="bindata sqlite" .
12
+
13
+ .PHONY : docker-build
14
+ docker-build :
15
+ docker run -ti --rm -v $(CURDIR ) :/srv/app/src/code.gitea.io/gitea -w /srv/app/src/code.gitea.io/gitea -e TAGS=" bindata $( TAGS) " webhippie/golang:edge make clean generate build
You can’t perform that action at this time.
0 commit comments