File tree Expand file tree Collapse file tree 3 files changed +35
-15
lines changed Expand file tree Collapse file tree 3 files changed +35
-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.9-alpine3.7 AS build-env
5
+ LABEL maintainer=
"[email protected] "
6
+
7
+ ARG GITEA_VERSION
8
+ ARG TAGS="sqlite"
9
+ ENV TAGS "bindata $TAGS"
10
+
11
+ # Build deps
12
+ RUN apk --no-cache add build-base git
13
+
14
+ # Setup repo
15
+ COPY . ${GOPATH}/src/code.gitea.io/gitea
16
+ WORKDIR ${GOPATH}/src/code.gitea.io/gitea
17
+
18
+ # Checkout version if set
19
+ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}" ; fi \
20
+ && make clean generate build
21
+
1
22
FROM alpine:3.7
2
- LABEL maintainer="The Gitea Authors "
23
+ LABEL maintainer=
"[email protected] "
3
24
4
25
EXPOSE 22 3000
5
26
6
27
RUN apk --no-cache add \
7
- su-exec \
8
- ca-certificates \
9
- sqlite \
10
28
bash \
29
+ ca-certificates \
30
+ curl \
31
+ gettext \
11
32
git \
12
33
linux-pam \
13
- s6 \
14
- curl \
15
34
openssh \
16
- gettext \
35
+ s6 \
36
+ sqlite \
37
+ su-exec \
17
38
tzdata
39
+
18
40
RUN addgroup \
19
41
-S -g 1000 \
20
42
git && \
@@ -29,12 +51,11 @@ RUN addgroup \
29
51
30
52
ENV USER git
31
53
ENV GITEA_CUSTOM /data/gitea
32
- ENV GODEBUG=netdns=go
33
54
34
55
VOLUME ["/data" ]
35
56
36
57
ENTRYPOINT ["/usr/bin/entrypoint" ]
37
58
CMD ["/bin/s6-svscan" , "/etc/s6" ]
38
59
39
60
COPY docker /
40
- COPY gitea /app/gitea/gitea
61
+ 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