Skip to content

Commit

Permalink
build: move build artifacts into build/ (project-zot#986)
Browse files Browse the repository at this point in the history
Unclutter the root dir by moving all docker/stacker build artifacts into
build/ folder.

Signed-off-by: Ramkumar Chinchani <[email protected]>
  • Loading branch information
rchincha authored Nov 10, 2022
1 parent 94d073c commit 97e7f7f
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -250,14 +250,15 @@ run-container:
.PHONY: binary-stacker
binary-stacker:
${STACKER} build \
-f build/stacker.yaml \
--substitute COMMIT=$(PWD) \
--substitute OS=$(OS) \
--substitute ARCH=$(ARCH) \
--substitute PWD=$(PWD)

.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; \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion stacker-conformance.yaml → build/stacker-conformance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion stacker-zb.yaml → build/stacker-zb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion stacker-zxp.yaml → build/stacker-zxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion stacker.yaml → build/stacker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/metrics/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox/annotations.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down

0 comments on commit 97e7f7f

Please sign in to comment.