Skip to content

Commit

Permalink
Allow to build uchiwa packages in docker
Browse files Browse the repository at this point in the history
It's really helpful to have an ability to build uchiwa package
in docker image, without installing additional dependencies on
host system
  • Loading branch information
SergK committed Dec 17, 2017
1 parent 33a6263 commit 6e4251d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
22 changes: 22 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:1.8.1-alpine

ENV GOARCH=amd64

# Disable cgo so that binaries we build will be fully static.
ENV CGO_ENABLED=0

RUN apk add --no-cache \
bash \
build-base \
git \
libffi-dev \
make \
nodejs \
rpm \
ruby-dev \
ruby-rake \
tar && \
gem install rake -v "10.5.0" --no-ri --no-rdoc && \
gem install fpm -v "1.8.1" --no-ri --no-rdoc && \
rm -rf /usr/lib/ruby/gems/*/cache/* && \
rm -rf ~/.gem
6 changes: 4 additions & 2 deletions build/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ echo "" > coverage.txt

for d in $(go list ./... | grep -v vendor); do
race=""
if [ $GOARCH == "amd64" ]; then
# The race detector is broken on Alpine. That is #14481 (and #9918).
# So disable it for now.
if [ "${GOARCH}" = "amd64" ] && [ ! -f /etc/alpine-release ]; then
race="-race"
fi

go test $race -coverprofile=profile.out -covermode=atomic $d
go test $race -coverprofile=profile.out -covermode=atomic "$d"
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
Expand Down

0 comments on commit 6e4251d

Please sign in to comment.