0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00

Merge pull request #12 from rchincha/gorilla-mux

build: support building inside a container using stacker
This commit is contained in:
Serge Hallyn 2019-08-14 18:33:51 -05:00 committed by GitHub
commit d8cde533f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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