This repository has been archived by the owner on Jun 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaced goxc with Docker+fpm workflow
- Loading branch information
Showing
3 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
FROM golang:1.7 | ||
|
||
ENV goup_version 0.2.1 | ||
|
||
# install fpm | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
ruby \ | ||
ruby-dev \ | ||
gcc \ | ||
make \ | ||
rpm \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& gem install fpm | ||
|
||
# install govendor | ||
RUN wget --no-verbose -O /usr/local/bin/govendor https://github.com/kardianos/govendor/releases/download/v1.0.8/govendor_linux_amd64 \ | ||
&& chmod +x /usr/local/bin/govendor | ||
|
||
# create volume for files and directories to be served by Goup | ||
RUN mkdir /data | ||
VOLUME /data | ||
|
||
# create directory for Goup binary and packages | ||
RUN mkdir /builds | ||
|
||
# build Goup | ||
RUN mkdir -p /go/src/goup | ||
WORKDIR /go/src/goup | ||
COPY . /go/src/goup | ||
RUN govendor sync | ||
RUN go build -o /builds/goup -ldflags "-X main.VERSION=$goup_version" -v . | ||
|
||
# create DEB and RPM packages | ||
WORKDIR /builds | ||
RUN fpm -s dir -t deb --name goup --version $goup_version ./goup=/usr/local/bin/goup | ||
RUN fpm -s dir -t rpm --name goup --version $goup_version ./goup=/usr/local/bin/goup | ||
|
||
EXPOSE 4000 | ||
|
||
WORKDIR /go/src/goup | ||
CMD ["go-wrapper", "run", "-dir", "/data"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
GOUP_IMAGE ?= goup | ||
GOUP_PORT ?= 4000 | ||
GOUP_DIR ?= $(PWD) | ||
|
||
image: | ||
docker build --tag $(GOUP_IMAGE) . | ||
|
||
builds: image | ||
GOUP_CONTAINER=$$(docker create $(GOUP_IMAGE)) && \ | ||
docker cp $$GOUP_CONTAINER:/builds . ; \ | ||
docker rm $$GOUP_CONTAINER | ||
|
||
run: image | ||
docker run --rm -v $(GOUP_DIR):/data -p $(GOUP_PORT):4000 $(GOUP_IMAGE) |