0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-30 22:34:13 -05:00

build: support building inside a container using stacker

This commit is contained in:
Ramkumar Chinchani 2019-08-14 16:26:25 -07:00
parent 09301f17fb
commit f2cd6b7b9a
3 changed files with 27 additions and 1 deletions

View file

@ -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

View file

@ -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
```
@ -28,7 +34,7 @@ Build artifacts are in bin/
# Running
bin/zot serve _<config>_
bin/zot serve <config>
# Caveats

16
stacker.yaml Normal file
View file

@ -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