Skip to content

Commit

Permalink
build: support building inside a container using stacker
Browse files Browse the repository at this point in the history
  • Loading branch information
rchincha committed Aug 14, 2019
1 parent 09301f1 commit f2cd6b7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ binary-container:
${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f Dockerfile -t zot:latest .
${CONTAINER_RUNTIME} run --rm --security-opt label=disable -v $$(pwd):/go/src/github.com/anuvu/zot \
zot:latest make

.PHONY: binary-stacker
binary-stacker:
stacker build --substitute PWD=$$PWD --no-cache
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
make binary-container
```

* Alternatively, build inside a container using [stacker](https://github.com/anuvu/stacker) (preferred)

```
make binary-stacker
```

* Build using host's toolchain

```
Expand All @@ -28,7 +34,7 @@ Build artifacts are in bin/

# Running

bin/zot serve _<config>_
bin/zot serve <config>

# Caveats

Expand Down
16 changes: 16 additions & 0 deletions stacker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
build:
from:
type: docker
url: docker://golang:1.12.8
binds:
- ${{PWD}} -> /go/src/github.com/anuvu/zot
run: |
export GO111MODULE=on
export GOPATH='/go'
export HOME='/root'
export PATH='/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
go get -u github.com/swaggo/swag/cmd/swag
cd /go/src/github.com/anuvu/zot
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.17.1
make
build_only: true

0 comments on commit f2cd6b7

Please sign in to comment.