From d4bfd3971350ea543c5c9a8f4f8aa60c7c064ae0 Mon Sep 17 00:00:00 2001 From: Jean Mertz Date: Fri, 5 Jun 2015 19:38:01 +0200 Subject: [PATCH] update Dockerfile implementation * fix $GOPATH usage * improve layer caching --- .dockerignore | 11 +++++++++++ Dockerfile | 30 +++++++++++++++--------------- 2 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..2641bb0b5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +bin/ +cmd/drone-server/drone_bindata.go +dist/ +doc/ + +.dockerignore +.drone.yml +.gitignore +Dockerfile +LICENSE +README.md diff --git a/Dockerfile b/Dockerfile index 4eb996aab..4ce6a8624 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,19 @@ -# Docker image for Drone's slack notification plugin -# -# docker build --rm=true -t drone/drone-server . - FROM golang:1.4.2 + ENV DRONE_SERVER_PORT :80 - -ADD . /gopath/src/github.com/drone/drone/ -WORKDIR /gopath/src/github.com/drone/drone - -RUN apt-get update \ - && apt-get install -y libsqlite3-dev \ - && git clone git://github.com/gin-gonic/gin.git $GOPATH/src/github.com/gin-gonic/gin \ - && go get -u github.com/jteeuwen/go-bindata/... \ - && make bindata deps \ - && make build +WORKDIR $GOPATH/src/github.com/drone/drone EXPOSE 80 -ENTRYPOINT ["/gopath/src/github.com/drone/drone/bin/drone"] \ No newline at end of file + +ENTRYPOINT ["/usr/local/bin/drone"] + +RUN apt-get update \ + && apt-get install -y libsqlite3-dev \ + && git clone git://github.com/gin-gonic/gin.git $GOPATH/src/github.com/gin-gonic/gin \ + && go get -u github.com/jteeuwen/go-bindata/... + +ADD . . +RUN make bindata deps \ + && make build \ + && mv bin/* /usr/local/bin/ \ + && rm -rf bin cmd/drone-server/drone_bindata.go