Skip to content

Commit

Permalink
build env
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaln7 committed Mar 24, 2019
1 parent 8056220 commit 2af8eb4
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
builds:
- binary: karmabot
main: ./cmd/karmabot/main.go
ldflags: -s -w -extldflags "-static" -X "github.com/kamaln7/karmabot.Version={{.Version}}"
ldflags: -s -w -X "github.com/kamaln7/karmabot.Version={{.Version}}"
goos:
- linux
goarch:
- amd64
- binary: karmabotctl
main: ./cmd/karmabotctl/main.go
ldflags: -s -w -extldflags "-static" -X "github.com/kamaln7/karmabot.Version={{.Version}}"
ldflags: -s -w -X "github.com/kamaln7/karmabot.Version={{.Version}}"
goos:
- linux
goarch:
Expand Down
17 changes: 17 additions & 0 deletions Dockerfile-build-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM golang:1.11-alpine

# Need to mount /var/run/docker.sock
# Need to mount /root/.config/goreleaser/github_token
# Need to mount /go/src/github.com/kamaln7/karmabot

RUN apk add --no-cache alpine-sdk git docker

RUN mkdir /tmp/goreleaser && \
cd /tmp/goreleaser && \
wget -O goreleaser.tgz https://github.com/goreleaser/goreleaser/releases/download/v0.104.0/goreleaser_Linux_x86_64.tar.gz && \
tar vxf goreleaser.tgz && \
mv goreleaser /bin && \
rm -r /tmp/goreleaser

WORKDIR /go/src/github.com/kamaln7/karmabot
ENTRYPOINT ["goreleaser"]
2 changes: 0 additions & 2 deletions cmd/karmabot/Dockerfile-goreleaser
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM alpine:3.6
RUN apk add --no-cache sqlite ca-certificates
# See http://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
COPY karmabot /
ENTRYPOINT ["/karmabot"]
2 changes: 0 additions & 2 deletions cmd/karmabot/Dockerfile-webui-goreleaser
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM alpine:3.6
RUN apk add --no-cache sqlite ca-certificates
# See http://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
COPY karmabot /
COPY www /www
EXPOSE 4000
Expand Down
2 changes: 0 additions & 2 deletions cmd/karmabotctl/Dockerfile-goreleaser
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM alpine:3.6
RUN apk add --no-cache sqlite ca-certificates
# See http://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
COPY karmabotctl /
ENTRYPOINT ["/karmabotctl"]
11 changes: 11 additions & 0 deletions goreleaser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

cd "${0%/*}"

docker run \
--rm -ti --privileged \
-v $(pwd):/go/src/github.com/kamaln7/karmabot \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $HOME/.config/goreleaser/github_token:/root/.config/goreleaser/github_token \
-v $HOME/.docker/config.json:/root/.docker/config.json \
karmabot-goreleaser $@
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package karmabot

// Version is the current version of karmabot.
const Version = "-dev"
var Version = "-dev"

0 comments on commit 2af8eb4

Please sign in to comment.