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

build: move build artifacts into build/ (#986)

Unclutter the root dir by moving all docker/stacker build artifacts into
build/ folder.

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
This commit is contained in:
Ramkumar Chinchani 2022-11-10 12:09:39 -08:00 committed by GitHub
parent 94d073ceab
commit 97e7f7f756
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 24 additions and 15 deletions

View file

@ -134,7 +134,7 @@ jobs:
- name: Build and push zot container image
uses: project-stacker/stacker-build-push-action@main
with:
file: 'stacker.yaml'
file: 'build/stacker.yaml'
build-args: |
RELEASE_TAG=${{ github.event.release.tag_name }}
COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
@ -180,7 +180,7 @@ jobs:
- name: Build and push zot-minimal container image
uses: project-stacker/stacker-build-push-action@main
with:
file: 'stacker.yaml'
file: 'build/stacker.yaml'
build-args: |
RELEASE_TAG=${{ github.event.release.tag_name }}
COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
@ -227,7 +227,7 @@ jobs:
- name: Build and push zot-exporter container image
uses: project-stacker/stacker-build-push-action@main
with:
file: 'stacker-zxp.yaml'
file: 'build/stacker-zxp.yaml'
build-args: |
RELEASE_TAG=${{ github.event.release.tag_name }}
COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}
@ -273,7 +273,7 @@ jobs:
- name: Build and push zb container image
uses: project-stacker/stacker-build-push-action@main
with:
file: 'stacker-zb.yaml'
file: 'build/stacker-zb.yaml'
build-args: |
RELEASE_TAG=${{ github.event.release.tag_name }}
COMMIT=${{ github.event.release.tag_name }}-${{ github.sha }}

View file

@ -240,7 +240,7 @@ verify-gql-committed:
.PHONY: binary-container
binary-container:
${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f Dockerfile -t zot-build:latest .
${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f build/Dockerfile -t zot-build:latest .
.PHONY: run-container
run-container:
@ -250,6 +250,7 @@ run-container:
.PHONY: binary-stacker
binary-stacker:
${STACKER} build \
-f build/stacker.yaml \
--substitute COMMIT=$(PWD) \
--substitute OS=$(OS) \
--substitute ARCH=$(ARCH) \
@ -257,7 +258,7 @@ binary-stacker:
.PHONY: image
image:
${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f Dockerfile -t zot:latest .
${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f build/Dockerfile -t zot:latest .
$(BATS):
rm -rf bats-core; \

View file

@ -125,7 +125,7 @@ Examples of config files are available in [examples/](examples/) dir.
# Container Image
The [Dockerfile](./Dockerfile) in this repo can be used to build a container image
The [Dockerfile](./build/Dockerfile) in this repo can be used to build a container image
that runs _zot_.
To build the image with ref `zot:latest`:

View file

@ -42,9 +42,11 @@ build:
build_only: true
"${{REPO_NAME:zot}}":
os: ${{OS}}
arch: ${{ARCH}}
from:
type: docker
url: docker://gcr.io/distroless/base
url: docker://gcr.io/distroless/base:latest-${{ARCH}}
overlay_dirs:
- source: ./build/binary
dest: /usr/local/bin

View file

@ -20,9 +20,11 @@ build:
build_only: true
"${{REPO_NAME:zb}}":
os: ${{OS}}
arch: ${{ARCH}}
from:
type: docker
url: docker://gcr.io/distroless/base
url: docker://gcr.io/distroless/base:latest-${{ARCH}}
overlay_dirs:
- source: ./build/binary
dest: /usr/local/bin

View file

@ -40,9 +40,11 @@ build:
build_only: true
"${{REPO_NAME:zxp}}":
os: ${{OS}}
arch: ${{ARCH}}
from:
type: docker
url: docker://gcr.io/distroless/base
url: docker://gcr.io/distroless/base:latest-${{ARCH}}
overlay_dirs:
- source: ./build/binary
dest: /usr/local/bin

View file

@ -39,9 +39,11 @@ build:
build_only: true
"${{REPO_NAME:zot}}":
os: ${{OS}}
arch: ${{ARCH}}
from:
type: docker
url: docker://gcr.io/distroless/base
url: docker://gcr.io/distroless/base:latest-${{ARCH}}
overlay_dirs:
- source: ./build/binary
dest: /usr/local/bin

View file

@ -2,7 +2,7 @@ CONTAINER_RUNTIME := docker
.PHONY: binary-container
binary-container:
${CONTAINER_RUNTIME} build -f Dockerfile -t zot-build:latest ../../.
${CONTAINER_RUNTIME} build -f build/Dockerfile -t zot-build:latest ../../.
.PHONY: run-container
run-container:
@ -11,7 +11,7 @@ run-container:
.PHONY: binary-minimal-container
binary-minimal-container:
${CONTAINER_RUNTIME} build -f Dockerfile-minimal -t zot-minimal:latest ../../.
${CONTAINER_RUNTIME} build -f build/Dockerfile-minimal -t zot-minimal:latest ../../.
.PHONY: run-minimal-container
run-minimal-container:
@ -20,7 +20,7 @@ run-minimal-container:
.PHONY: binary-exporter-container
binary-exporter-container:
${CONTAINER_RUNTIME} build -f Dockerfile-zxp -t zxp:latest ../../.
${CONTAINER_RUNTIME} build -f build/Dockerfile-zxp -t zxp:latest ../../.
.PHONY: run-exporter-container
run-exporter-container:

View file

@ -66,7 +66,7 @@ function teardown_file() {
}
@test "build image with podman and specify annotations" {
run podman build -t 127.0.0.1:8080/annotations:latest . --format oci --annotation org.opencontainers.image.vendor="CentOS" --annotation org.opencontainers.image.licenses="GPLv2"
run podman build -f build/Dockerfile -t 127.0.0.1:8080/annotations:latest . --format oci --annotation org.opencontainers.image.vendor="CentOS" --annotation org.opencontainers.image.licenses="GPLv2"
[ "$status" -eq 0 ]
run podman push 127.0.0.1:8080/annotations:latest --tls-verify=false --format=oci
[ "$status" -eq 0 ]