mirror of
https://github.com/project-zot/zot.git
synced 2024-12-30 22:34:13 -05:00
Merge pull request #12 from rchincha/gorilla-mux
build: support building inside a container using stacker
This commit is contained in:
commit
d8cde533f5
3 changed files with 27 additions and 1 deletions
4
Makefile
4
Makefile
|
@ -42,3 +42,7 @@ binary-container:
|
||||||
${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f Dockerfile -t zot:latest .
|
${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 \
|
${CONTAINER_RUNTIME} run --rm --security-opt label=disable -v $$(pwd):/go/src/github.com/anuvu/zot \
|
||||||
zot:latest make
|
zot:latest make
|
||||||
|
|
||||||
|
.PHONY: binary-stacker
|
||||||
|
binary-stacker:
|
||||||
|
stacker build --substitute PWD=$$PWD --no-cache
|
||||||
|
|
|
@ -17,6 +17,12 @@
|
||||||
make binary-container
|
make binary-container
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Alternatively, build inside a container using [stacker](https://github.com/anuvu/stacker) (preferred)
|
||||||
|
|
||||||
|
```
|
||||||
|
make binary-stacker
|
||||||
|
```
|
||||||
|
|
||||||
* Build using host's toolchain
|
* Build using host's toolchain
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -28,7 +34,7 @@ Build artifacts are in bin/
|
||||||
|
|
||||||
# Running
|
# Running
|
||||||
|
|
||||||
bin/zot serve _<config>_
|
bin/zot serve <config>
|
||||||
|
|
||||||
# Caveats
|
# Caveats
|
||||||
|
|
||||||
|
|
16
stacker.yaml
Normal file
16
stacker.yaml
Normal 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
|
Loading…
Reference in a new issue