mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-22 18:01:02 +00:00
added alpine build image
This commit is contained in:
parent
be8f31f0fd
commit
c6b9d09602
5 changed files with 57 additions and 2 deletions
|
@ -3,6 +3,7 @@ cmd/drone-server/drone_bindata.go
|
||||||
dist/
|
dist/
|
||||||
doc/
|
doc/
|
||||||
|
|
||||||
|
.git/
|
||||||
.dockerignore
|
.dockerignore
|
||||||
.drone.yml
|
.drone.yml
|
||||||
.gitignore
|
.gitignore
|
||||||
|
|
26
Dockerfile.alpine
Normal file
26
Dockerfile.alpine
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# Docker image for the Drone build runner
|
||||||
|
#
|
||||||
|
# docker build --file=Dockerfile.alpine --rm=true -t drone/drone-alpine .
|
||||||
|
|
||||||
|
FROM alpine:3.2
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENV GOROOT=/usr/lib/go \
|
||||||
|
GOPATH=/gopath \
|
||||||
|
GOBIN=/gopath/bin \
|
||||||
|
PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
||||||
|
|
||||||
|
WORKDIR /gopath/src/github.com/drone/drone
|
||||||
|
ADD . /gopath/src/github.com/drone/drone
|
||||||
|
|
||||||
|
RUN apk add -U go ca-certificates libc-dev gcc git sqlite-libs && \
|
||||||
|
go get github.com/jteeuwen/go-bindata/... && \
|
||||||
|
/gopath/bin/go-bindata -o="cmd/drone-server/drone_bindata.go" cmd/drone-server/static/... && \
|
||||||
|
go run make.go build && \
|
||||||
|
apk del git go gcc libc-dev && \
|
||||||
|
mv bin/drone /bin/drone && \
|
||||||
|
rm -rf /gopath && \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/drone"]
|
25
cmd/drone-build/Dockerfile.alpine
Normal file
25
cmd/drone-build/Dockerfile.alpine
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# Docker image for the Drone build runner
|
||||||
|
#
|
||||||
|
# cd $GOPATH/src/github.com/drone/drone
|
||||||
|
# docker build --file=cmd/drone-build/Dockerfile.alpine --rm=true -t drone/drone-build .
|
||||||
|
|
||||||
|
FROM alpine:3.2
|
||||||
|
|
||||||
|
ENV GOROOT=/usr/lib/go \
|
||||||
|
GOPATH=/gopath \
|
||||||
|
GOBIN=/gopath/bin \
|
||||||
|
CGO_ENABLED=0 \
|
||||||
|
PATH=$PATH:$GOROOT/bin:$GOPATH/bin
|
||||||
|
|
||||||
|
WORKDIR /gopath/src/github.com/drone/drone
|
||||||
|
ADD . /gopath/src/github.com/drone/drone
|
||||||
|
|
||||||
|
RUN apk add -U go ca-certificates && \
|
||||||
|
cd cmd/drone-build && \
|
||||||
|
go build -a -tags netgo && \
|
||||||
|
apk del go && \
|
||||||
|
mv drone-build /bin/drone-build && \
|
||||||
|
rm -rf /gopath && \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/drone-build"]
|
|
@ -241,7 +241,7 @@ func main() {
|
||||||
http.Handle("/static/", static())
|
http.Handle("/static/", static())
|
||||||
http.Handle("/", r)
|
http.Handle("/", r)
|
||||||
|
|
||||||
err = http.ListenAndServe(settings.Server.Addr, nil)
|
err = http.ListenAndServe(conf.server.addr, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Cannot start server: ", err)
|
log.Error("Cannot start server: ", err)
|
||||||
}
|
}
|
||||||
|
|
5
make.go
5
make.go
|
@ -154,6 +154,9 @@ func trace(args []string) {
|
||||||
// helper function to parse the git revision
|
// helper function to parse the git revision
|
||||||
func rev() string {
|
func rev() string {
|
||||||
cmd := exec.Command("git", "rev-parse", "--short", "HEAD")
|
cmd := exec.Command("git", "rev-parse", "--short", "HEAD")
|
||||||
raw, _ := cmd.CombinedOutput()
|
raw, err := cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
return "HEAD"
|
||||||
|
}
|
||||||
return strings.Trim(string(raw), "\n")
|
return strings.Trim(string(raw), "\n")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue