mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 04:48:26 +08:00
ci/cd: Fix arm builds, use distroless final image
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
62775cc095
commit
d0b52612a2
+17
-16
@@ -5,7 +5,7 @@ build:
|
||||
binds:
|
||||
- . -> /zotcopy
|
||||
run: |
|
||||
export GO111MODULE=on
|
||||
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'
|
||||
@@ -14,7 +14,7 @@ build:
|
||||
cd /go/src/github.com/project-zot
|
||||
git clone /zotcopy zot
|
||||
cd /go/src/github.com/project-zot/zot
|
||||
make COMMIT=${{COMMIT}} OS=${{OS}} ARCH=${{ARCH}} binary${{EXT:}}
|
||||
make COMMIT=${{COMMIT}} OS=${{OS}} ARCH=${{ARCH}} clean binary${{EXT:}}
|
||||
cat > config.json << EOF
|
||||
{
|
||||
"storage":{
|
||||
@@ -31,28 +31,29 @@ build:
|
||||
EOF
|
||||
|
||||
cat config.json
|
||||
mkdir -p /zotcopy/build/binary
|
||||
mkdir -p /zotcopy/build/cert
|
||||
mkdir -p /zotcopy/build/config
|
||||
cp /go/src/github.com/project-zot/zot/bin/zot-${{OS}}-${{ARCH}}${{EXT:}} /zotcopy/build/binary
|
||||
cp /go/src/github.com/project-zot/zot/config.json /zotcopy/build/config
|
||||
cp /etc/ssl/certs/ca-certificates.crt /zotcopy/build/cert
|
||||
build_only: true
|
||||
|
||||
"${{REPO_NAME:zot}}":
|
||||
from:
|
||||
type: docker
|
||||
url: docker://alpine:3
|
||||
import:
|
||||
- stacker://build/go/src/github.com/project-zot/zot/bin/zot-${{OS}}-${{ARCH}}${{EXT:}}
|
||||
- stacker://build/go/src/github.com/project-zot/zot/config.json
|
||||
- stacker://build/etc/ssl/certs/ca-certificates.crt
|
||||
run: |
|
||||
cp /stacker/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
cp /stacker/zot-${{OS}}-${{ARCH}}${{EXT:}} /usr/bin/zot
|
||||
mkdir -p /etc/zot
|
||||
cp /stacker/config.json /etc/zot/config.json
|
||||
# pie mode binaries need a runtime
|
||||
apk add --no-cache libc6-compat
|
||||
url: docker://gcr.io/distroless/base
|
||||
overlay_dirs:
|
||||
- source: ./build/binary
|
||||
dest: /usr/local/bin
|
||||
- source: ./build/cert
|
||||
dest: /etc/ssl/certs
|
||||
- source: ./build/config
|
||||
dest: /etc/zot
|
||||
entrypoint:
|
||||
- /usr/bin/zot
|
||||
- /usr/local/bin/zot-${{OS}}-${{ARCH}}${{EXT:}}
|
||||
volumes:
|
||||
- /var/lib/registry
|
||||
cmd:
|
||||
- serve
|
||||
- /etc/zot/config.json
|
||||
|
||||
|
||||
Reference in New Issue
Block a user